mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-25 14:44:35 +00:00
Compare commits
134
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb87007dfd | ||
|
|
8318b6a614 | ||
|
|
143a01f6c2 | ||
|
|
9c00a7d61f | ||
|
|
a431e2a65c | ||
|
|
aa803a1e51 | ||
|
|
d08e48b73b | ||
|
|
3d3260cd71 | ||
|
|
ff70c8b2e3 | ||
|
|
c1ac213eab | ||
|
|
54c339e03e | ||
|
|
d34cd0445a | ||
|
|
8655f8b0a8 | ||
|
|
886c8819c0 | ||
|
|
539ddce15f | ||
|
|
f60a89dcce | ||
|
|
3a3c7035fe | ||
|
|
c943d0c35a | ||
|
|
ec610dc876 | ||
|
|
2ae1f8ba93 | ||
|
|
7b9537571e | ||
|
|
b031b59002 | ||
|
|
4073a4c04c | ||
|
|
643d9b72ba | ||
|
|
fa3b49a673 | ||
|
|
165e5db275 | ||
|
|
4fcfaffa63 | ||
|
|
21690ddb09 | ||
|
|
1cb9a96d4f | ||
|
|
12460a6e02 | ||
|
|
20d2fc8c3f | ||
|
|
3f395fef1d | ||
|
|
2593b14c53 | ||
|
|
72341f1633 | ||
|
|
8a7a4a79f0 | ||
|
|
2e1a20d829 | ||
|
|
39e860974a | ||
|
|
1464929264 | ||
|
|
c4c1953ae1 | ||
|
|
6efa21100b | ||
|
|
c3e1675ac8 | ||
|
|
cc9b8ab774 | ||
|
|
674d2b389b | ||
|
|
78dbb36fec | ||
|
|
6385002193 | ||
|
|
e969289b22 | ||
|
|
f95fa2752f | ||
|
|
e963872d9e | ||
|
|
7a6076d9cd | ||
|
|
39b96c5ec0 | ||
|
|
d81198fa0a | ||
|
|
5b169882bc | ||
|
|
30ad41cc57 | ||
|
|
4588690780 | ||
|
|
a00cd59d4c | ||
|
|
e5f830ebb1 | ||
|
|
6fc3505ae7 | ||
|
|
51883263d7 | ||
|
|
97fd3003e3 | ||
|
|
14f6a09b9a | ||
|
|
40144a0fa5 | ||
|
|
4ce0134bed | ||
|
|
21caa10d34 | ||
|
|
4001d105a8 | ||
|
|
b5514a9aa0 | ||
|
|
c1f3c93bc3 | ||
|
|
5a2852532b | ||
|
|
189b3bc95c | ||
|
|
126ca91eeb | ||
|
|
477b6e354c | ||
|
|
c312d2c311 | ||
|
|
4c0218c708 | ||
|
|
3568223fc6 | ||
|
|
019f9a670a | ||
|
|
29be0033d7 | ||
|
|
2165ec04ea | ||
|
|
3da974b1cf | ||
|
|
637001538c | ||
|
|
95c8c72db5 | ||
|
|
2415e17583 | ||
|
|
0cabe335dd | ||
|
|
568e405e25 | ||
|
|
e851556159 | ||
|
|
b610b590a2 | ||
|
|
6788f10a3e | ||
|
|
691d3a2962 | ||
|
|
a99686e3a8 | ||
|
|
6064b7bc3d | ||
|
|
3b8a85a20d | ||
|
|
772987a4f2 | ||
|
|
33f240c73a | ||
|
|
06ec360694 | ||
|
|
e9e63d6fc5 | ||
|
|
83cd16061f | ||
|
|
13ecd240fe | ||
|
|
64b5b41f02 | ||
|
|
15a0f7f6c6 | ||
|
|
66fb9ddbb3 | ||
|
|
0fff3926fe | ||
|
|
2e62cb2a32 | ||
|
|
2db573f5c3 | ||
|
|
ff494012ed | ||
|
|
d5dbfe5f6d | ||
|
|
a2b32f4d73 | ||
|
|
2a93fbd33d | ||
|
|
52496b770a | ||
|
|
c964972006 | ||
|
|
cd20d23b1b | ||
|
|
631c562f34 | ||
|
|
3e6930d1f1 | ||
|
|
82955ad34d | ||
|
|
d726351abc | ||
|
|
ea103bcc80 | ||
|
|
f4291635b2 | ||
|
|
739e5fc9c3 | ||
|
|
0aab92fe6c | ||
|
|
52b110a0da | ||
|
|
afb21dcf8c | ||
|
|
c0dd868ca6 | ||
|
|
966fad56ca | ||
|
|
9beab25b7a | ||
|
|
f471a0c094 | ||
|
|
2150548111 | ||
|
|
df216f68b4 | ||
|
|
834beb5ac8 | ||
|
|
a0f11f404a | ||
|
|
9899ca1177 | ||
|
|
1d94ff613d | ||
|
|
494addb994 | ||
|
|
e17147a14c | ||
|
|
605d47eeed | ||
|
|
0147be4afb | ||
|
|
f5d9bee22e | ||
|
|
aa90eb92a4 |
No files matched your search
@@ -3,9 +3,9 @@ name: Build and test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: Optimize images
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master, main, release/** ]
|
||||||
|
paths:
|
||||||
|
- "**/*.png"
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches: [ master, main, release/** ]
|
||||||
|
paths:
|
||||||
|
- "**/*.png"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
optimize-images:
|
||||||
|
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||||
|
secrets: inherit
|
||||||
@@ -27,3 +27,5 @@ whitelist.json
|
|||||||
*.iws
|
*.iws
|
||||||
src/main/resources/mixins.*.json
|
src/main/resources/mixins.*.json
|
||||||
*.bat
|
*.bat
|
||||||
|
layout.json
|
||||||
|
.DS_Store
|
||||||
+3
-3
@@ -1,5 +1,6 @@
|
|||||||
Contributing
|
Contributing
|
||||||
============
|
============
|
||||||
|
Before contributing, make sure you're familiar with the [GT:NH Contribution Guidelines](https://github.com/GTNewHorizons/.github/blob/master/CONTRIBUTING.md)
|
||||||
___
|
___
|
||||||
Setting up a Development Environment
|
Setting up a Development Environment
|
||||||
------------------------------------
|
------------------------------------
|
||||||
@@ -15,7 +16,7 @@ To set up the mod as to allow you to make changes, do the following:
|
|||||||
|
|
||||||
### IntelliJ IDEA
|
### IntelliJ IDEA
|
||||||
1. Run `gradlew idea`.
|
1. Run `gradlew idea`.
|
||||||
2. Open IntelliJ and point to either the project folder or the build.gradle file.
|
2. Open IntelliJ and point to either the project folder or the `build.gradle` file.
|
||||||
3. After opening the project in IntelliJ, run `gradlew genIntellijRuns` in the command terminal you opened earlier.
|
3. After opening the project in IntelliJ, run `gradlew genIntellijRuns` in the command terminal you opened earlier.
|
||||||
|
|
||||||
### Eclipse
|
### Eclipse
|
||||||
@@ -24,9 +25,8 @@ To set up the mod as to allow you to make changes, do the following:
|
|||||||
2. Open Eclipse and import the folder as a project.
|
2. Open Eclipse and import the folder as a project.
|
||||||
|
|
||||||
You now have a functional local copy of Chisel, ready to develop on.
|
You now have a functional local copy of Chisel, ready to develop on.
|
||||||
|
|
||||||
___
|
___
|
||||||
Formatting
|
Formatting
|
||||||
----------
|
----------
|
||||||
|
|
||||||
When coding for Chisel 2, please use the provided [formatter settings](eclipseFormat.xml) to format your code. Poorly formatted code, or PRs which reformat existing code will likely not be accepted.
|
When coding for the GTNH branch, please run `gradlew spotlessApply` before posting a PR.
|
||||||
@@ -12,9 +12,7 @@ It was previously maintained by [tterrag](http://github.com/tterrag1098), [Drull
|
|||||||
Pull Requests
|
Pull Requests
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Pull requests with new features, translations, and bugfixes are very welcome. Please make sure to always submit PRs against the ***dev*** branch, not master.
|
Pull requests with new features, translations, and bugfixes are very welcome.
|
||||||
|
|
||||||
Do not make PRs that are solely formatting or other aesthetic things.
|
|
||||||
|
|
||||||
If your PR is going to take a lot of work, it may be best to make an issue so we can discuss the feature before you create it.
|
If your PR is going to take a lot of work, it may be best to make an issue so we can discuss the feature before you create it.
|
||||||
|
|
||||||
@@ -22,10 +20,9 @@ See the [CONTRIBUTING](CONTRIBUTING.md) file for more details.
|
|||||||
|
|
||||||
Issue Reporting
|
Issue Reporting
|
||||||
----------------
|
----------------
|
||||||
If you wish to report an issue with the mod, please submit one to the issue tracker in this repository. When creating an
|
If you wish to report an issue with this version of the mod, please submit one to the [GTNH issue tracker](https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues). When creating an
|
||||||
issue, please be sure to include:
|
issue, please be sure to include:
|
||||||
|
|
||||||
- The version of Chisel you are using ("latest" is not an acceptable version)
|
- The version of Chisel or GTNH you are using ("latest" is not an acceptable version)
|
||||||
- The version of Forge you are using
|
- The crash report (preferably via [Pastebin](http://pastebin.com/)) generated by the error, if any
|
||||||
- If applicable, the crash report (preferably via [Pastebin](http://pastebin.com/)). generated by the error
|
|
||||||
- Depending on the error, an image of the problem
|
- Depending on the error, an image of the problem
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
compileJava {
|
|
||||||
options.encoding = "UTF-8"
|
|
||||||
}
|
|
||||||
+2
-1482
File diff suppressed because it is too large.
Load diff
+10
-9
@@ -1,22 +1,23 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile("com.github.GTNewHorizons:CodeChickenCore:1.1.5:dev")
|
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.12:dev")
|
||||||
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev")
|
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.84-GTNH:dev")
|
||||||
compile("com.github.GTNewHorizons:NotEnoughItems:2.2.8-GTNH:dev")
|
implementation("com.github.GTNewHorizons:ForgeMultipart:2.0.0:dev")
|
||||||
|
|
||||||
compileOnly("org.projectlombok:lombok:1.18.24")
|
compileOnly("org.projectlombok:lombok:1.18.24")
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.24")
|
annotationProcessor("org.projectlombok:lombok:1.18.24")
|
||||||
|
|
||||||
shadowImplementation("com.github.GTNewHorizons:CTMLib:1.4.4:dev")
|
devOnlyNonPublishable("com.github.GTNewHorizons:waila:1.19.22:dev") {
|
||||||
|
|
||||||
compileOnly("com.github.GTNewHorizons:waila:1.5.19:dev") {
|
|
||||||
transitive = false
|
|
||||||
}
|
|
||||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev") {
|
|
||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
|
devOnlyNonPublishable("com.github.GTNewHorizons:WailaHarvestability:1.3.4-GTNH:dev")
|
||||||
|
|
||||||
compileOnly("curse.maven:ee3-65509:2305023") { // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
compileOnly("curse.maven:ee3-65509:2305023") { // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileOnly("com.github.GTNewHorizons:Angelica:2.1.15:api") {
|
||||||
|
transitive = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+202
-28
@@ -1,64 +1,238 @@
|
|||||||
|
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||||
|
# LOCAL to test local config updates.
|
||||||
|
gtnh.settings.blowdryerTag = 0.2.2
|
||||||
|
|
||||||
|
# Human-readable mod name, available for mcmod.info population.
|
||||||
modName = Chisel
|
modName = Chisel
|
||||||
|
|
||||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||||
|
# Conventionally lowercase.
|
||||||
modId = chisel
|
modId = chisel
|
||||||
|
|
||||||
|
# Root package of the mod, used to find various classes in other properties,
|
||||||
|
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||||
modGroup = com.cricketcraft.chisel
|
modGroup = com.cricketcraft.chisel
|
||||||
|
|
||||||
# WHY is there no version field?
|
# Whether to use modGroup as the maven publishing group.
|
||||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
# When false, com.github.GTNewHorizons is used.
|
||||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
useModGroupForPublishing = false
|
||||||
|
|
||||||
# Will update your build.gradle automatically whenever an update is available
|
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||||
autoUpdateBuildScript = false
|
autoUpdateBuildScript = false
|
||||||
|
|
||||||
|
# Version of Minecraft to target
|
||||||
minecraftVersion = 1.7.10
|
minecraftVersion = 1.7.10
|
||||||
|
|
||||||
|
# Version of Minecraft Forge to target
|
||||||
forgeVersion = 10.13.4.1614
|
forgeVersion = 10.13.4.1614
|
||||||
|
|
||||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
|
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||||
# restart Minecraft in development. Choose this dependent on your mod:
|
channel = stable
|
||||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
|
||||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
|
||||||
developmentEnvironmentUserName = "Developer"
|
|
||||||
|
|
||||||
# Define a source file of your project with:
|
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
mappingsVersion = 12
|
||||||
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
|
|
||||||
# version in @Mod([...], version = VERSION, [...])
|
# Defines other MCP mappings for dependency deobfuscation.
|
||||||
# Leave these properties empty to skip individual token replacements
|
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||||
replaceGradleTokenInFile = Chisel.java
|
|
||||||
|
# Select a default username for testing your mod. You can always override this per-run by running
|
||||||
|
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||||
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
|
# Enables modern Java syntax support. Valid values:
|
||||||
|
# - false: No modern syntax, Java 8 only
|
||||||
|
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||||
|
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||||
|
# - modern: Native modern Java bytecode, no downgrading
|
||||||
|
enableModernJavaSyntax = jabel
|
||||||
|
|
||||||
|
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||||
|
# and should *not* be used in most situations. -1 disables this.
|
||||||
|
# forceToolchainVersion = -1
|
||||||
|
|
||||||
|
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||||
|
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||||
|
# downgradeTargetVersion = 8
|
||||||
|
|
||||||
|
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||||
|
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||||
|
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||||
|
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||||
|
|
||||||
|
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||||
|
# - shade: Shade minimized stubs into the jar
|
||||||
|
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||||
|
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||||
|
# - (empty): Warning reminding you to configure stubs
|
||||||
|
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||||
|
# jvmDowngraderStubsProvider =
|
||||||
|
|
||||||
|
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||||
|
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||||
|
enableGenericInjection = false
|
||||||
|
|
||||||
|
# Generate a class with a String field for the mod version named as defined below.
|
||||||
|
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||||
|
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||||
|
generateGradleTokenClass = team.chisel.Tags
|
||||||
|
|
||||||
|
# Name of the token containing the project's current version to generate/replace.
|
||||||
|
gradleTokenVersion = VERSION
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod ID replacement token.
|
||||||
gradleTokenModId =
|
gradleTokenModId =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod name replacement token.
|
||||||
gradleTokenModName =
|
gradleTokenModName =
|
||||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
|
||||||
|
# [DEPRECATED] Mod Group replacement token.
|
||||||
gradleTokenGroupName =
|
gradleTokenGroupName =
|
||||||
|
|
||||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can
|
# [DEPRECATED]
|
||||||
|
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||||
|
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||||
|
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||||
|
# version in @Mod([...], version = VERSION, [...]).
|
||||||
|
# Leave these properties empty to skip individual token replacements.
|
||||||
|
replaceGradleTokenInFile =
|
||||||
|
|
||||||
|
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||||
# leave this property empty.
|
# leave this property empty.
|
||||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
|
||||||
apiPackage = api
|
apiPackage = api
|
||||||
|
|
||||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||||
# Example value: mymodid_at.cfg
|
# There can be multiple files in a space-separated list.
|
||||||
|
# Example value: mymodid_at.cfg nei_at.cfg
|
||||||
accessTransformersFile = chisel_compile_at.cfg
|
accessTransformersFile = chisel_compile_at.cfg
|
||||||
|
|
||||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||||
usesMixins = false
|
usesMixins = false
|
||||||
|
|
||||||
|
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||||
|
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||||
|
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||||
|
separateMixinSourceSet =
|
||||||
|
|
||||||
|
# Adds some debug arguments like verbose output and class export.
|
||||||
|
usesMixinDebug = false
|
||||||
|
|
||||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||||
mixinPlugin =
|
mixinPlugin =
|
||||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
|
||||||
|
# Specify the package that contains all of your Mixins. The package must exist or
|
||||||
|
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||||
|
# it must match with this or the build will fail.
|
||||||
mixinsPackage =
|
mixinsPackage =
|
||||||
|
|
||||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||||
# This parameter is for legacy compatability only
|
# This parameter is for legacy compatibility only
|
||||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||||
coreModClass =
|
coreModClass =
|
||||||
|
|
||||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||||
containsMixinsAndOrCoreModOnly = false
|
containsMixinsAndOrCoreModOnly = false
|
||||||
|
|
||||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||||
# responsibility check the licence and request permission for distribution, if required.
|
forceEnableMixins = false
|
||||||
|
|
||||||
|
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||||
|
# responsibility to check the license and request permission for distribution if required.
|
||||||
usesShadowedDependencies = true
|
usesShadowedDependencies = true
|
||||||
|
|
||||||
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||||
|
# their own classes, making the minimization unreliable.
|
||||||
|
minimizeShadowedDependencies = true
|
||||||
|
|
||||||
|
# If disabled, won't rename the shadowed classes.
|
||||||
|
relocateShadowedDependencies = false
|
||||||
|
|
||||||
|
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||||
|
includeWellKnownRepositories = true
|
||||||
|
|
||||||
|
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||||
|
# list of strings, with the acceptable keys being(case does not matter):
|
||||||
|
# cursemaven
|
||||||
|
# modrinth
|
||||||
|
excludeWellKnownRepositories =
|
||||||
|
|
||||||
|
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||||
|
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||||
|
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||||
|
usesMavenPublishing = true
|
||||||
|
|
||||||
|
# Maven repository to publish the mod to.
|
||||||
|
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||||
|
|
||||||
|
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||||
|
#
|
||||||
|
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||||
|
# Leave this empty if you don't want to publish to Modrinth.
|
||||||
|
modrinthProjectId =
|
||||||
|
|
||||||
|
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||||
|
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||||
|
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||||
|
# type can be one of [project, version],
|
||||||
|
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||||
|
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||||
|
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||||
|
modrinthRelations =
|
||||||
|
|
||||||
|
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||||
|
#
|
||||||
|
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||||
|
# Leave this empty if you don't want to publish on CurseForge.
|
||||||
|
curseForgeProjectId =
|
||||||
|
|
||||||
|
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||||
|
# Syntax: type1:name1;type2:name2;...
|
||||||
|
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||||
|
# and the name is the CurseForge project slug of the other mod.
|
||||||
|
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||||
|
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||||
|
curseForgeRelations =
|
||||||
|
|
||||||
|
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||||
# projects. New projects should not use this parameter.
|
# projects. New projects should not use this parameter.
|
||||||
#customArchiveBaseName =
|
# customArchiveBaseName =
|
||||||
|
|
||||||
|
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||||
|
# runClientWorkingDirectory = run/client
|
||||||
|
|
||||||
|
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||||
|
# runServerWorkingDirectory = run/server
|
||||||
|
|
||||||
|
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||||
|
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||||
|
# The check is ONLY performed if the version is a git tag.
|
||||||
|
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||||
|
# versionPattern =
|
||||||
|
|
||||||
|
# Uncomment to prevent the source code from being published.
|
||||||
|
# noPublishedSources = true
|
||||||
|
|
||||||
|
# Uncomment this to disable Spotless checks.
|
||||||
|
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||||
|
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||||
|
# disableSpotless = true
|
||||||
|
|
||||||
|
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||||
|
# disableCheckstyle = true
|
||||||
|
|
||||||
|
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||||
|
# (force use delegated build).
|
||||||
|
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||||
|
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||||
|
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||||
|
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||||
|
# ideaOverrideBuildType = idea
|
||||||
|
|
||||||
|
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||||
|
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||||
|
# ideaCheckSpotlessOnBuild = true
|
||||||
|
|
||||||
|
# Non-GTNH properties
|
||||||
|
org.gradle.configuration-cache = true
|
||||||
|
org.gradle.parallel = true
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#This file is generated by updateDaemonJvm
|
||||||
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||||
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||||
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||||
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||||
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||||
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
|
||||||
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||||
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||||
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||||
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
||||||
|
toolchainVersion=25
|
||||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -83,10 +85,8 @@ done
|
|||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -133,10 +132,13 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
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.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
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
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
@@ -144,7 +146,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -152,7 +154,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -169,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -197,16 +198,19 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
# double quotes to make sure that they get re-expanded; and
|
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
Vendored
+13
-12
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,22 +59,21 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
@@ -1,14 +1,4 @@
|
|||||||
// Add any additional repositories for your dependencies here
|
// Add any additional repositories for your dependencies here
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
|
||||||
name = "GTNH"
|
|
||||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
url "https://cursemaven.com"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
url = "https://jitpack.io"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+5
-10
@@ -4,10 +4,10 @@ pluginManagement {
|
|||||||
maven {
|
maven {
|
||||||
// RetroFuturaGradle
|
// RetroFuturaGradle
|
||||||
name "GTNH Maven"
|
name "GTNH Maven"
|
||||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||||
allowInsecureProtocol = true
|
|
||||||
mavenContent {
|
mavenContent {
|
||||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
includeGroup("com.gtnewhorizons")
|
||||||
|
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
@@ -17,12 +17,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blowdryerSetup {
|
|
||||||
repoSubfolder 'gtnhShared'
|
|
||||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
|
||||||
//devLocal '.' // Use this when testing config updates locally
|
|
||||||
}
|
|
||||||
@@ -2,12 +2,12 @@ package com.cricketcraft.chisel.api;
|
|||||||
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.ctmlib.ICTMBlock;
|
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
|
|
||||||
|
import team.chisel.ctmlib.ICTMBlock;
|
||||||
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To be implemented on blocks that can be chiseled and need advanced metadata to variation mapping. Currently not very
|
* To be implemented on blocks that can be chiseled and need advanced metadata to variation mapping. Currently not very
|
||||||
* usable without internal classes.
|
* usable without internal classes.
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.cricketcraft.chisel.api;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be implemented on an {@link IBlockAccess} that renders blocks which are only part of a block space, so it can
|
||||||
|
* decide connected textures itself instead of reporting the blocks around it.
|
||||||
|
* <p>
|
||||||
|
* Connected textures ask this for every location they check, while rendering in this world. Render bounds smaller than
|
||||||
|
* the block are then a part of the block: they show the matching part of the block's connected texture, instead of the
|
||||||
|
* whole texture squeezed into the bounds.
|
||||||
|
*/
|
||||||
|
public interface IConnectionAccess {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the given location shows the block being rendered, as seen from the block being rendered.
|
||||||
|
*
|
||||||
|
* @param x X coord of the block to check against. NOT the position of the block being rendered.
|
||||||
|
* @param y Y coord of the block to check against.
|
||||||
|
* @param z Z coord of the block to check against.
|
||||||
|
* @param side The side being rendered, NOT the side being connected from.
|
||||||
|
* <p>
|
||||||
|
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||||
|
* @param fromX X coord of the block being rendered. It is not necessarily adjacent, it can also be diagonal to the
|
||||||
|
* location.
|
||||||
|
* @param fromY Y coord of the block being rendered.
|
||||||
|
* @param fromZ Z coord of the block being rendered.
|
||||||
|
* @param block The block being rendered.
|
||||||
|
* @param meta The metadata of the block being rendered.
|
||||||
|
* @return True if the location shows the given block and metadata.
|
||||||
|
*/
|
||||||
|
boolean matches(int x, int y, int z, int side, int fromX, int fromY, int fromZ, Block block, int meta);
|
||||||
|
}
|
||||||
@@ -36,4 +36,57 @@ public interface IFacade {
|
|||||||
* @return The metadata of your facade block.
|
* @return The metadata of your facade block.
|
||||||
*/
|
*/
|
||||||
int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side);
|
int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the block this facade is acting as towards the block that is checking for a connection. Implement this if
|
||||||
|
* the facade can show different blocks to different neighbours.
|
||||||
|
* <p>
|
||||||
|
* Defaults to {@link #getFacade(IBlockAccess, int, int, int, int)}.
|
||||||
|
*
|
||||||
|
* @param world {@link World}
|
||||||
|
* @param x X coord of your block
|
||||||
|
* @param y Y coord of your block
|
||||||
|
* @param z Z coord of your block
|
||||||
|
* @param side The side being rendered, NOT the side being connected from.
|
||||||
|
* <p>
|
||||||
|
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||||
|
* @param fromX X coord of the block being rendered, which is checking for a connection. NOT the position of
|
||||||
|
* your block. It is not necessarily adjacent, it can also be diagonal to your block.
|
||||||
|
* @param fromY Y coord of the block being rendered.
|
||||||
|
* @param fromZ Z coord of the block being rendered.
|
||||||
|
* @param fromBlock The block being rendered.
|
||||||
|
* @param fromMeta The metadata of the block being rendered.
|
||||||
|
* @return The block inside of your facade block, as seen from the block being rendered.
|
||||||
|
*/
|
||||||
|
default Block getFacade(IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY, int fromZ,
|
||||||
|
Block fromBlock, int fromMeta) {
|
||||||
|
return getFacade(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the metadata of the block that this facade is acting as towards the block that is checking for a
|
||||||
|
* connection. Implement this together with
|
||||||
|
* {@link #getFacade(IBlockAccess, int, int, int, int, int, int, int, Block, int)}.
|
||||||
|
* <p>
|
||||||
|
* Defaults to {@link #getFacadeMetadata(IBlockAccess, int, int, int, int)}.
|
||||||
|
*
|
||||||
|
* @param world {@link World}
|
||||||
|
* @param x X coord of your block
|
||||||
|
* @param y Y coord of your block
|
||||||
|
* @param z Z coord of your block
|
||||||
|
* @param side The side being rendered, NOT the side being connected from.
|
||||||
|
* <p>
|
||||||
|
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||||
|
* @param fromX X coord of the block being rendered, which is checking for a connection. NOT the position of
|
||||||
|
* your block. It is not necessarily adjacent, it can also be diagonal to your block.
|
||||||
|
* @param fromY Y coord of the block being rendered.
|
||||||
|
* @param fromZ Z coord of the block being rendered.
|
||||||
|
* @param fromBlock The block being rendered.
|
||||||
|
* @param fromMeta The metadata of the block being rendered.
|
||||||
|
* @return The metadata of your facade block, as seen from the block being rendered.
|
||||||
|
*/
|
||||||
|
default int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY, int fromZ,
|
||||||
|
Block fromBlock, int fromMeta) {
|
||||||
|
return getFacadeMetadata(world, x, y, z, side);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,8 @@ import net.minecraft.util.ChatComponentTranslation;
|
|||||||
public class Statistics {
|
public class Statistics {
|
||||||
|
|
||||||
public static StatBase blocksChiseled = (new StatBasic(
|
public static StatBase blocksChiseled = (new StatBasic(
|
||||||
"stat.blockChiseled",
|
"stat.blockChiseled",
|
||||||
new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
|
new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
blocksChiseled.initIndependentStat();
|
blocksChiseled.initIndependentStat();
|
||||||
|
|||||||
@@ -15,16 +15,18 @@ import net.minecraft.util.IIcon;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||||
import com.cricketcraft.chisel.api.FMPIMC;
|
import com.cricketcraft.chisel.api.FMPIMC;
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.block.BlockCarvableGlowie;
|
||||||
|
import team.chisel.compat.fmp.FMPCompat;
|
||||||
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
public class CarvableHelper {
|
public class CarvableHelper {
|
||||||
|
|
||||||
@@ -73,7 +75,7 @@ public class CarvableHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material,
|
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material,
|
||||||
String modid) {
|
String modid) {
|
||||||
addVariation(description, metadata, null, bb, blockMeta, modid);
|
addVariation(description, metadata, null, bb, blockMeta, modid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +84,7 @@ public class CarvableHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta,
|
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta,
|
||||||
String modid) {
|
String modid) {
|
||||||
addVariation(description, metadata, texture, block, blockMeta, modid, null, metadata);
|
addVariation(description, metadata, texture, block, blockMeta, modid, null, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,12 +93,13 @@ public class CarvableHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid,
|
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid,
|
||||||
ISubmapManager customManager, int order) {
|
ISubmapManager customManager, int order) {
|
||||||
|
|
||||||
if (infoList.size() >= 16) return;
|
if (infoList.size() >= 16) return;
|
||||||
|
|
||||||
IVariationInfo info = FMLCommonHandler.instance().getSide().isClient()
|
IVariationInfo info = FMLCommonHandler.instance()
|
||||||
? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order)
|
.getSide()
|
||||||
|
.isClient() ? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order)
|
||||||
: getServerInfo(modid, texture, description, metadata, block, blockMeta, customManager, order);
|
: getServerInfo(modid, texture, description, metadata, block, blockMeta, customManager, order);
|
||||||
|
|
||||||
infoList.add(info);
|
infoList.add(info);
|
||||||
@@ -104,12 +107,12 @@ public class CarvableHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IVariationInfo getClientInfo(String modid, String texture, String description, int metadata, Block block,
|
private IVariationInfo getClientInfo(String modid, String texture, String description, int metadata, Block block,
|
||||||
int blockMeta, ISubmapManager customManager, int order) {
|
int blockMeta, ISubmapManager customManager, int order) {
|
||||||
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order);
|
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order);
|
||||||
TextureType type = TextureType.getTypeFor(this, modid, texture);
|
TextureType type = TextureType.getTypeFor(this, modid, texture);
|
||||||
if (type == TextureType.CUSTOM && customManager == null && block == null) {
|
if (type == TextureType.CUSTOM && customManager == null && block == null) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format("Could not find texture %s, and no custom texture manager was provided.", texture));
|
String.format("Could not find texture %s, and no custom texture manager was provided.", texture));
|
||||||
}
|
}
|
||||||
|
|
||||||
ISubmapManager manager;
|
ISubmapManager manager;
|
||||||
@@ -124,7 +127,7 @@ public class CarvableHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block,
|
private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block,
|
||||||
int blockMeta, ISubmapManager customManager, int order) {
|
int blockMeta, ISubmapManager customManager, int order) {
|
||||||
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order);
|
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order);
|
||||||
return new VariationInfoBase(var, description, null);
|
return new VariationInfoBase(var, description, null);
|
||||||
}
|
}
|
||||||
@@ -184,15 +187,24 @@ public class CarvableHelper {
|
|||||||
|
|
||||||
public void registerVariation(String name, IVariationInfo info) {
|
public void registerVariation(String name, IVariationInfo info) {
|
||||||
|
|
||||||
Block block = info.getVariation().getBlock();
|
Block block = info.getVariation()
|
||||||
|
.getBlock();
|
||||||
|
|
||||||
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
if (Loader.isModLoaded("ForgeMultipart") && block instanceof BlockCarvableGlowie) {
|
||||||
FMPIMC.registerFMP(block, info.getVariation().getBlockMeta());
|
FMPCompat.registerGlowieVariation(info, block);
|
||||||
|
} else {
|
||||||
|
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
||||||
|
FMPIMC.registerFMP(
|
||||||
|
block,
|
||||||
|
info.getVariation()
|
||||||
|
.getBlockMeta());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forbidChiseling) return;
|
if (forbidChiseling) return;
|
||||||
|
|
||||||
CarvingUtils.getChiselRegistry().addVariation(name, info.getVariation());
|
CarvingUtils.getChiselRegistry()
|
||||||
|
.addVariation(name, info.getVariation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@@ -204,7 +216,12 @@ public class CarvableHelper {
|
|||||||
|
|
||||||
public void registerSubBlocks(Block block, CreativeTabs tabs, List<ItemStack> list) {
|
public void registerSubBlocks(Block block, CreativeTabs tabs, List<ItemStack> list) {
|
||||||
for (IVariationInfo info : infoList) {
|
for (IVariationInfo info : infoList) {
|
||||||
list.add(new ItemStack(block, 1, info.getVariation().getItemMeta()));
|
list.add(
|
||||||
|
new ItemStack(
|
||||||
|
block,
|
||||||
|
1,
|
||||||
|
info.getVariation()
|
||||||
|
.getItemMeta()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,8 +231,9 @@ public class CarvableHelper {
|
|||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getMissingIcon() {
|
public IIcon getMissingIcon() {
|
||||||
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture))
|
return ((TextureMap) Minecraft.getMinecraft()
|
||||||
.getAtlasSprite("missingno");
|
.getTextureManager()
|
||||||
|
.getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Block getBlock() {
|
public Block getBlock() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public interface IChiselMode {
|
|||||||
* NOTE: This method is responsible for increasing the "Blocks Chiseled" statistic found in the Statistics class.
|
* NOTE: This method is responsible for increasing the "Blocks Chiseled" statistic found in the Statistics class.
|
||||||
*/
|
*/
|
||||||
void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
||||||
ICarvingVariation variation);
|
ICarvingVariation variation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implemented implicitly by enums. If your IChiselMode is not an enum constant, this needs to be implemented
|
* Implemented implicitly by enums. If your IChiselMode is not an enum constant, this needs to be implemented
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.cricketcraft.chisel.api.carving;
|
package com.cricketcraft.chisel.api.carving;
|
||||||
|
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
|
|
||||||
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
public interface IVariationInfo extends ISubmapManager {
|
public interface IVariationInfo extends ISubmapManager {
|
||||||
|
|
||||||
ICarvingVariation getVariation();
|
ICarvingVariation getVariation();
|
||||||
|
|||||||
@@ -8,16 +8,16 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
|
|
||||||
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
public class VariationInfoBase implements IVariationInfo {
|
public class VariationInfoBase implements IVariationInfo {
|
||||||
|
|
||||||
private ICarvingVariation variation;
|
private final ICarvingVariation variation;
|
||||||
private String unlocDesc;
|
private final String unlocDesc;
|
||||||
private ISubmapManager manager;
|
private final ISubmapManager manager;
|
||||||
private TextureType type;
|
private final TextureType type;
|
||||||
|
|
||||||
public VariationInfoBase(ICarvingVariation variation, String unlocDesc, ISubmapManager manager) {
|
public VariationInfoBase(ICarvingVariation variation, String unlocDesc, ISubmapManager manager) {
|
||||||
this(variation, unlocDesc, manager, TextureType.CUSTOM);
|
this(variation, unlocDesc, manager, TextureType.CUSTOM);
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
package com.cricketcraft.chisel.api.carving;
|
package com.cricketcraft.chisel.api.carving;
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||||
|
|
||||||
import cpw.mods.fml.common.API;
|
import cpw.mods.fml.common.API;
|
||||||
@@ -6,6 +6,11 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.client.resources.FallbackResourceManager;
|
||||||
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
|
import net.minecraft.client.resources.IResourcePack;
|
||||||
|
import net.minecraft.client.resources.SimpleReloadableResourceManager;
|
||||||
|
import net.minecraft.launchwrapper.Launch;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
@@ -15,18 +20,18 @@ import org.apache.commons.lang3.ArrayUtils;
|
|||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.apache.commons.lang3.tuple.Triple;
|
import org.apache.commons.lang3.tuple.Triple;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
|
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.ctmlib.CTM;
|
import team.chisel.ctmlib.CTM;
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
import team.chisel.ctmlib.RenderBlocksColumn;
|
import team.chisel.ctmlib.RenderBlocksColumn;
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles all default {@link ISubmapManager} behavior
|
* Handles all default {@link ISubmapManager} behavior
|
||||||
*/
|
*/
|
||||||
@@ -85,15 +90,15 @@ public enum TextureType {
|
|||||||
return data.getRight();
|
return data.getRight();
|
||||||
|
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
boolean topConnected = ctm.isConnected(world, x, y + 1, z, side, block, meta);
|
boolean topConnected = ctm.isConnected(world, x, y + 1, z, side, x, y, z, block, meta);
|
||||||
boolean botConnected = ctm.isConnected(world, x, y - 1, z, side, block, meta);
|
boolean botConnected = ctm.isConnected(world, x, y - 1, z, side, x, y, z, block, meta);
|
||||||
|
|
||||||
TextureSubmap map = data.getLeft();
|
TextureSubmap map = data.getLeft();
|
||||||
if (topConnected && botConnected)
|
if (topConnected && botConnected)
|
||||||
return map.getSubIcon(0, 1);
|
return map.getSubIcon(0, 1);
|
||||||
if (topConnected && !botConnected)
|
if (topConnected)
|
||||||
return map.getSubIcon(1, 1);
|
return map.getSubIcon(1, 1);
|
||||||
if (!topConnected && botConnected)
|
if (botConnected)
|
||||||
return map.getSubIcon(1, 0);
|
return map.getSubIcon(1, 0);
|
||||||
return map.getSubIcon(0, 0);
|
return map.getSubIcon(0, 0);
|
||||||
}
|
}
|
||||||
@@ -101,10 +106,9 @@ public enum TextureType {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) {
|
protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) {
|
||||||
RenderBlocksColumn ret = theRenderBlocksColumn;
|
RenderBlocksColumn ret = theRenderBlocksColumn.get();
|
||||||
Pair<TextureSubmap, IIcon> data = (Pair<TextureSubmap, IIcon>) cachedObject;
|
Pair<TextureSubmap, IIcon> data = (Pair<TextureSubmap, IIcon>) cachedObject;
|
||||||
|
|
||||||
ret.blockAccess = world;
|
|
||||||
ret.renderMaxX = 1.0;
|
ret.renderMaxX = 1.0;
|
||||||
ret.renderMaxY = 1.0;
|
ret.renderMaxY = 1.0;
|
||||||
ret.renderMaxZ = 1.0;
|
ret.renderMaxZ = 1.0;
|
||||||
@@ -138,11 +142,11 @@ public enum TextureType {
|
|||||||
boolean reverse = side == 3 || side == 4;
|
boolean reverse = side == 3 || side == 4;
|
||||||
|
|
||||||
if (side < 4) {
|
if (side < 4) {
|
||||||
p = ctm.isConnected(world, x - 1, y, z, side, block, meta);
|
p = ctm.isConnected(world, x - 1, y, z, side, x, y, z, block, meta);
|
||||||
n = ctm.isConnected(world, x + 1, y, z, side, block, meta);
|
n = ctm.isConnected(world, x + 1, y, z, side, x, y, z, block, meta);
|
||||||
} else {
|
} else {
|
||||||
p = ctm.isConnected(world, x, y, z - 1, side, block, meta);
|
p = ctm.isConnected(world, x, y, z - 1, side, x, y, z, block, meta);
|
||||||
n = ctm.isConnected(world, x, y, z + 1, side, block, meta);
|
n = ctm.isConnected(world, x, y, z + 1, side, x, y, z, block, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureSubmap map = data.getLeft();
|
TextureSubmap map = data.getLeft();
|
||||||
@@ -206,14 +210,12 @@ public enum TextureType {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) {
|
protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) {
|
||||||
RenderBlocksCTM ret = theRenderBlocksCTM;
|
RenderBlocksCTM ret = theRenderBlocksCTM.get();
|
||||||
Triple<?, TextureSubmap, TextureSubmap> data = (Triple<?, TextureSubmap, TextureSubmap>) cachedObject;
|
Triple<?, TextureSubmap, TextureSubmap> data = (Triple<?, TextureSubmap, TextureSubmap>) cachedObject;
|
||||||
ret.blockAccess = world;
|
|
||||||
|
|
||||||
ret.submap = data.getMiddle();
|
ret.submap = data.getMiddle();
|
||||||
ret.submapSmall = data.getRight();
|
ret.submapSmall = data.getRight();
|
||||||
|
|
||||||
ret.rendererOld = rendererOld;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -270,6 +272,8 @@ public enum TextureType {
|
|||||||
CUSTOM;
|
CUSTOM;
|
||||||
|
|
||||||
/* Some util stuff for shared code between v* and r* */
|
/* Some util stuff for shared code between v* and r* */
|
||||||
|
public static final boolean fixedBottomFaceUV = (boolean) Launch.blackboard
|
||||||
|
.getOrDefault("hodgepodge.FixesConfig.fixBottomFaceUV", Boolean.FALSE);
|
||||||
|
|
||||||
public static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
|
public static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
|
||||||
int variationSize = (type == TextureType.V9) ? 3 : 2;
|
int variationSize = (type == TextureType.V9) ? 3 : 2;
|
||||||
@@ -290,6 +294,9 @@ public enum TextureType {
|
|||||||
//For DOWN, reverse the indexes for only Z
|
//For DOWN, reverse the indexes for only Z
|
||||||
textureZ = (variationSize - textureZ - 1);
|
textureZ = (variationSize - textureZ - 1);
|
||||||
}*/
|
}*/
|
||||||
|
else if (side == 0 && fixedBottomFaceUV) {
|
||||||
|
textureX = variationSize - textureX - 1;
|
||||||
|
}
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
if (side == 0 || side == 1) {
|
if (side == 0 || side == 1) {
|
||||||
@@ -325,28 +332,19 @@ public enum TextureType {
|
|||||||
private static final TextureType[] VALUES;
|
private static final TextureType[] VALUES;
|
||||||
private static final CTM ctm = CTM.getInstance();
|
private static final CTM ctm = CTM.getInstance();
|
||||||
private static final Random rand = new Random();
|
private static final Random rand = new Random();
|
||||||
@SideOnly(Side.CLIENT)
|
private static final ThreadLocal<RenderBlocksCTM> theRenderBlocksCTM = FMLLaunchHandler.side().isClient() ? ThreadLocal.withInitial(RenderBlocksCTM::new) : null;
|
||||||
private static RenderBlocksCTM theRenderBlocksCTM;
|
private static final ThreadLocal<RenderBlocksColumn> theRenderBlocksColumn = FMLLaunchHandler.side().isClient() ? ThreadLocal.withInitial(RenderBlocksColumn::new) : null;
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
private static RenderBlocksColumn theRenderBlocksColumn;
|
|
||||||
|
|
||||||
private String[] suffixes;
|
private final String[] suffixes;
|
||||||
static {
|
static {
|
||||||
VALUES = ArrayUtils.subarray(values(), 0, values().length - 1);
|
VALUES = ArrayUtils.subarray(values(), 0, values().length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextureType(String... suffixes) {
|
TextureType(String... suffixes) {
|
||||||
this.suffixes = suffixes.length == 0 ? new String[] { "" } : suffixes;
|
this.suffixes = suffixes.length == 0 ? new String[] { "" } : suffixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initStatics() {
|
public ISubmapManager createManagerFor(ICarvingVariation variation, String texturePath) {
|
||||||
if (theRenderBlocksCTM == null) {
|
|
||||||
theRenderBlocksCTM = new RenderBlocksCTM();
|
|
||||||
theRenderBlocksColumn = new RenderBlocksColumn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISubmapManager createManagerFor(ICarvingVariation variation, String texturePath) {
|
|
||||||
return new SubmapManagerDefault(this, variation, texturePath);
|
return new SubmapManagerDefault(this, variation, texturePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,11 +388,25 @@ public enum TextureType {
|
|||||||
return CUSTOM;
|
return CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is ugly, but faster than class.getResource
|
|
||||||
private static boolean exists(String modid, String path, String postfix) {
|
private static boolean exists(String modid, String path, String postfix) {
|
||||||
ResourceLocation rl = new ResourceLocation(modid, "textures/blocks/" + path + postfix + ".png");
|
ResourceLocation rl = new ResourceLocation(modid, "textures/blocks/" + path + postfix + ".png");
|
||||||
|
|
||||||
|
final IResourceManager resMan = Minecraft.getMinecraft().getResourceManager();
|
||||||
|
if (resMan instanceof SimpleReloadableResourceManager simple) {
|
||||||
|
FallbackResourceManager fallback = (FallbackResourceManager)simple.domainResourceManagers.get(rl.getResourceDomain());
|
||||||
|
if (fallback != null) {
|
||||||
|
for (Object obj : fallback.resourcePacks) {
|
||||||
|
if (obj instanceof IResourcePack rp && rp.resourceExists(rl)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback
|
||||||
try {
|
try {
|
||||||
Minecraft.getMinecraft().getResourceManager().getAllResources(rl);
|
resMan.getAllResources(rl);
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
return false;
|
return false;
|
||||||
@@ -424,7 +436,6 @@ public enum TextureType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
initStatics();
|
|
||||||
RenderBlocks rb = type.createRenderContext(rendererOld, world, cachedObject);
|
RenderBlocks rb = type.createRenderContext(rendererOld, world, cachedObject);
|
||||||
rb.setRenderBoundsFromBlock(block);
|
rb.setRenderBoundsFromBlock(block);
|
||||||
return rb;
|
return rb;
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
package com.cricketcraft.chisel.api.rendering;
|
package com.cricketcraft.chisel.api.rendering;
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||||
|
|
||||||
import cpw.mods.fml.common.API;
|
import cpw.mods.fml.common.API;
|
||||||
@@ -5,9 +5,9 @@ import java.util.HashMap;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
import team.chisel.utils.General;
|
|
||||||
import cpw.mods.fml.common.FMLLog;
|
import cpw.mods.fml.common.FMLLog;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import team.chisel.utils.General;
|
||||||
|
|
||||||
public class BlockNameConversion {
|
public class BlockNameConversion {
|
||||||
|
|
||||||
@@ -30,7 +30,8 @@ public class BlockNameConversion {
|
|||||||
return newname;
|
return newname;
|
||||||
case 2: // rename "marbleSlab" -> "marble_slab", "redstone" ->
|
case 2: // rename "marbleSlab" -> "marble_slab", "redstone" ->
|
||||||
// "redstone_block"
|
// "redstone_block"
|
||||||
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase();
|
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2")
|
||||||
|
.toLowerCase();
|
||||||
|
|
||||||
if (newname.startsWith("block_")) {
|
if (newname.startsWith("block_")) {
|
||||||
newname = newname.replaceFirst("block_([a-z_]+)", "$1_block");
|
newname = newname.replaceFirst("block_([a-z_]+)", "$1_block");
|
||||||
@@ -39,7 +40,9 @@ public class BlockNameConversion {
|
|||||||
}
|
}
|
||||||
return newname;
|
return newname;
|
||||||
case 3: // rename "wood-dark-oak" -> "dark_oak_planks"
|
case 3: // rename "wood-dark-oak" -> "dark_oak_planks"
|
||||||
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replace('-', '_');
|
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2")
|
||||||
|
.toLowerCase()
|
||||||
|
.replace('-', '_');
|
||||||
if (newname.contains("wood_")) {
|
if (newname.contains("wood_")) {
|
||||||
newname = newname.replaceFirst("wood_([a-z_]+)", "$1_planks");
|
newname = newname.replaceFirst("wood_([a-z_]+)", "$1_planks");
|
||||||
}
|
}
|
||||||
@@ -48,7 +51,9 @@ public class BlockNameConversion {
|
|||||||
// "dirt" -> "dirt").
|
// "dirt" -> "dirt").
|
||||||
// This can be dangerous in cases like "carpet" (a block) ->
|
// This can be dangerous in cases like "carpet" (a block) ->
|
||||||
// "carpet" (NO block)
|
// "carpet" (NO block)
|
||||||
return oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replaceFirst("block_", "");
|
return oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2")
|
||||||
|
.toLowerCase()
|
||||||
|
.replaceFirst("block_", "");
|
||||||
default:
|
default:
|
||||||
throw new IndexOutOfBoundsException("conversion got invalid parameter step=" + step);
|
throw new IndexOutOfBoundsException("conversion got invalid parameter step=" + step);
|
||||||
}
|
}
|
||||||
@@ -83,14 +88,16 @@ public class BlockNameConversion {
|
|||||||
namingConversion.put("blockFft", "fantasyblock");
|
namingConversion.put("blockFft", "fantasyblock");
|
||||||
namingConversion.put("blockCarpetFloor", "carpet");
|
namingConversion.put("blockCarpetFloor", "carpet");
|
||||||
namingConversion.put("blockLaboratory", "laboratoryblock");
|
namingConversion.put("blockLaboratory", "laboratoryblock");
|
||||||
|
namingConversion.put("wroughtironblock", "castironblock");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item findItem(String oldname) {
|
public static Item findItem(String oldname) {
|
||||||
FMLLog.getLogger().trace("[Chisel 2] findItem() START " + oldname);
|
FMLLog.getLogger()
|
||||||
|
.trace("[Chisel 2] findItem() START " + oldname);
|
||||||
Item item = null;
|
Item item = null;
|
||||||
for (int i = 0; i < NameConversions.MAX && item == null; i++) {
|
for (int i = 0; i < NameConversions.MAX && item == null; i++) {
|
||||||
FMLLog.getLogger()
|
FMLLog.getLogger()
|
||||||
.trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i));
|
.trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i));
|
||||||
item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
|
item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,11 +105,12 @@ public class BlockNameConversion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Block findBlock(String oldname) {
|
public static Block findBlock(String oldname) {
|
||||||
FMLLog.getLogger().trace("[Chisel 2] findBlock() START: " + oldname);
|
FMLLog.getLogger()
|
||||||
|
.trace("[Chisel 2] findBlock() START: " + oldname);
|
||||||
Block block = null;
|
Block block = null;
|
||||||
for (int i = 0; i < NameConversions.MAX && block == null; i++) {
|
for (int i = 0; i < NameConversions.MAX && block == null; i++) {
|
||||||
FMLLog.getLogger()
|
FMLLog.getLogger()
|
||||||
.trace("[Chisel 2] findBlock() Checking for " + NameConversions.conversion(oldname, i));
|
.trace("[Chisel 2] findBlock() Checking for " + NameConversions.conversion(oldname, i));
|
||||||
block = GameRegistry.findBlock(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
|
block = GameRegistry.findBlock(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,23 +10,6 @@ import net.minecraftforge.common.config.Configuration;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import team.chisel.block.BlockCarvable;
|
|
||||||
import team.chisel.carving.Carving;
|
|
||||||
import team.chisel.compat.Compatibility;
|
|
||||||
import team.chisel.compat.IMCHandler;
|
|
||||||
import team.chisel.compat.fmp.FMPCompat;
|
|
||||||
import team.chisel.config.Configurations;
|
|
||||||
import team.chisel.entity.EntityChiselSnowman;
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
|
||||||
import team.chisel.init.TabsInit;
|
|
||||||
import team.chisel.item.ItemCarvable;
|
|
||||||
import team.chisel.item.chisel.ChiselController;
|
|
||||||
import team.chisel.network.ChiselGuiHandler;
|
|
||||||
import team.chisel.network.PacketHandler;
|
|
||||||
import team.chisel.proxy.CommonProxy;
|
|
||||||
import team.chisel.utils.General;
|
|
||||||
import team.chisel.world.GeneratorChisel;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||||
import com.cricketcraft.chisel.api.Statistics;
|
import com.cricketcraft.chisel.api.Statistics;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
@@ -52,30 +35,47 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
|||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||||
|
import team.chisel.block.BlockCarvable;
|
||||||
|
import team.chisel.carving.Carving;
|
||||||
|
import team.chisel.compat.Compatibility;
|
||||||
|
import team.chisel.compat.IMCHandler;
|
||||||
|
import team.chisel.compat.fmp.FMPCompat;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
import team.chisel.entity.EntityChiselSnowman;
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
import team.chisel.init.TabsInit;
|
||||||
|
import team.chisel.item.ItemCarvable;
|
||||||
|
import team.chisel.item.chisel.ChiselController;
|
||||||
|
import team.chisel.network.ChiselGuiHandler;
|
||||||
|
import team.chisel.network.PacketHandler;
|
||||||
|
import team.chisel.proxy.CommonProxy;
|
||||||
|
import team.chisel.utils.General;
|
||||||
|
import team.chisel.world.GeneratorChisel;
|
||||||
|
|
||||||
@Mod(
|
@Mod(
|
||||||
modid = Chisel.MOD_ID,
|
modid = Chisel.MOD_ID,
|
||||||
name = Chisel.MOD_NAME,
|
name = Chisel.MOD_NAME,
|
||||||
version = Chisel.VERSION,
|
version = Chisel.VERSION,
|
||||||
guiFactory = "team.chisel.client.gui.GuiFactory",
|
guiFactory = "team.chisel.client.gui.GuiFactory",
|
||||||
dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest")
|
dependencies = "after:EE3;after:ForgeMultipart@[2.0.0,);after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest;after:BiomesOPlenty")
|
||||||
public class Chisel {
|
public class Chisel {
|
||||||
|
|
||||||
public static final String MOD_ID = "chisel";
|
public static final String MOD_ID = "chisel";
|
||||||
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType(
|
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType(
|
||||||
"dig.stone",
|
"dig.stone",
|
||||||
MOD_ID + ":step.templeblock",
|
MOD_ID + ":step.templeblock",
|
||||||
1.0f,
|
1.0f,
|
||||||
1.0f);
|
1.0f);
|
||||||
public static final String MOD_NAME = "Chisel";
|
public static final String MOD_NAME = "Chisel";
|
||||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
public static final String VERSION = Tags.VERSION;
|
||||||
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType(
|
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType(
|
||||||
"holystone",
|
"holystone",
|
||||||
1.0f,
|
1.0f,
|
||||||
1.0f);
|
1.0f);
|
||||||
public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f);
|
public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f);
|
||||||
public static boolean multipartLoaded = false;
|
public static boolean multipartLoaded = false;
|
||||||
public static boolean gtnhLoaded = false;
|
public static boolean gtnhLoaded = false;
|
||||||
|
public static boolean iguanaTweaksLoaded = false;
|
||||||
public static int renderEldritchId;
|
public static int renderEldritchId;
|
||||||
public static int renderAutoChiselId;
|
public static int renderAutoChiselId;
|
||||||
public static int renderGlowId;
|
public static int renderGlowId;
|
||||||
@@ -117,23 +117,28 @@ public class Chisel {
|
|||||||
|
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
m.remap(block);
|
m.remap(block);
|
||||||
FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block));
|
FMLLog.getLogger()
|
||||||
} else FMLLog.getLogger().warn("Block " + m.name + " could not get remapped.");
|
.info("Remapping block " + m.name + " to " + General.getName(block));
|
||||||
|
} else FMLLog.getLogger()
|
||||||
|
.warn("Block " + m.name + " could not get remapped.");
|
||||||
} else if (m.type == Type.ITEM) {
|
} else if (m.type == Type.ITEM) {
|
||||||
final Item item = BlockNameConversion.findItem(m.name);
|
final Item item = BlockNameConversion.findItem(m.name);
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
m.remap(item);
|
m.remap(item);
|
||||||
FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));
|
FMLLog.getLogger()
|
||||||
|
.info("Remapping item " + m.name + " to " + General.getName(item));
|
||||||
|
|
||||||
} else FMLLog.getLogger().warn("Item " + m.name + " could not get remapped.");
|
} else FMLLog.getLogger()
|
||||||
|
.warn("Item " + m.name + " could not get remapped.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
FMLCommonHandler.instance().registerCrashCallable(new ChiselCrashCallable());
|
FMLCommonHandler.instance()
|
||||||
|
.registerCrashCallable(new ChiselCrashCallable());
|
||||||
|
|
||||||
File configFile = event.getSuggestedConfigurationFile();
|
File configFile = event.getSuggestedConfigurationFile();
|
||||||
Configurations.configExists = configFile.exists();
|
Configurations.configExists = configFile.exists();
|
||||||
@@ -144,6 +149,9 @@ public class Chisel {
|
|||||||
if (Loader.isModLoaded("dreamcraft")) {
|
if (Loader.isModLoaded("dreamcraft")) {
|
||||||
gtnhLoaded = true;
|
gtnhLoaded = true;
|
||||||
}
|
}
|
||||||
|
if (Loader.isModLoaded("IguanaTweaksTConstruct")) {
|
||||||
|
iguanaTweaksLoaded = true;
|
||||||
|
}
|
||||||
TabsInit.preInit();
|
TabsInit.preInit();
|
||||||
Features.preInit();
|
Features.preInit();
|
||||||
Statistics.init();
|
Statistics.init();
|
||||||
@@ -172,7 +180,9 @@ public class Chisel {
|
|||||||
|
|
||||||
proxy.init();
|
proxy.init();
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
FMLCommonHandler.instance().bus().register(instance);
|
FMLCommonHandler.instance()
|
||||||
|
.bus()
|
||||||
|
.register(instance);
|
||||||
|
|
||||||
FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register");
|
FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class ChiselCrashCallable implements ICrashCallable {
|
|||||||
@Override
|
@Override
|
||||||
public String call() throws Exception {
|
public String call() throws Exception {
|
||||||
return "Errors like \"[FML]: Unable to lookup ...\" are NOT the cause of this crash. "
|
return "Errors like \"[FML]: Unable to lookup ...\" are NOT the cause of this crash. "
|
||||||
+ "You can safely ignore these errors. And update forge while you're at it.";
|
+ "You can safely ignore these errors. And update forge while you're at it.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+3170
-1067
File diff suppressed because it is too large.
Load diff
@@ -36,7 +36,7 @@ public class BlockAutoChisel extends BlockContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1,
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1,
|
||||||
float y1, float z1) {
|
float y1, float z1) {
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
if (world.isRemote) return true;
|
if (world.isRemote) return true;
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.config.Configurations;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
@@ -22,6 +19,8 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
|||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockCarvable extends Block implements ICarvable {
|
public class BlockCarvable extends Block implements ICarvable {
|
||||||
|
|
||||||
@@ -145,7 +144,7 @@ public class BlockCarvable extends Block implements ICarvable {
|
|||||||
* @param frequency default 1.0f
|
* @param frequency default 1.0f
|
||||||
*/
|
*/
|
||||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
||||||
float frequency) {
|
float frequency) {
|
||||||
super(soundNameStep, volume, frequency);
|
super(soundNameStep, volume, frequency);
|
||||||
this.soundNameStep = soundNameStep;
|
this.soundNameStep = soundNameStep;
|
||||||
this.soundNameBreak = soundNameBreak;
|
this.soundNameBreak = soundNameBreak;
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ import net.minecraft.util.MovingObjectPosition;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
|
|
||||||
|
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
||||||
|
|
||||||
public static int renderId;
|
public static int renderId;
|
||||||
@@ -42,7 +42,7 @@ public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX,
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX,
|
||||||
float hitY, float hitZ) {
|
float hitY, float hitZ) {
|
||||||
if (world.isRemote) {
|
if (world.isRemote) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package team.chisel.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovementInput;
|
||||||
|
import net.minecraft.util.MovementInputFromOptions;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
|
public class BlockCarvableConcreteSlab extends BlockCarvableSlab {
|
||||||
|
|
||||||
|
public BlockCarvableConcreteSlab(BlockCarvable block) {
|
||||||
|
super(block);
|
||||||
|
top = new BlockCarvableConcreteSlab(this);
|
||||||
|
FMLCommonHandler.instance()
|
||||||
|
.bus()
|
||||||
|
.register(new EventHandler());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor to get concrete top slabs to work
|
||||||
|
public BlockCarvableConcreteSlab(BlockCarvableSlab bottomBlock) {
|
||||||
|
super(bottomBlock);
|
||||||
|
FMLCommonHandler.instance()
|
||||||
|
.bus()
|
||||||
|
.register(new EventHandler());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private static MovementInput manualInputCheck;
|
||||||
|
|
||||||
|
public class EventHandler {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void speedupPlayer(PlayerTickEvent event) {
|
||||||
|
if (event.phase == Phase.START && event.side.isClient()
|
||||||
|
&& event.player.onGround
|
||||||
|
&& event.player instanceof EntityPlayerSP) {
|
||||||
|
if (manualInputCheck == null) {
|
||||||
|
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||||
|
}
|
||||||
|
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||||
|
Block below = player.worldObj.getBlock(
|
||||||
|
MathHelper.floor_double(player.posX),
|
||||||
|
MathHelper.floor_double(player.posY) - 2,
|
||||||
|
MathHelper.floor_double(player.posZ));
|
||||||
|
|
||||||
|
if (below == BlockCarvableConcreteSlab.this) {
|
||||||
|
manualInputCheck.updatePlayerMoveState();
|
||||||
|
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||||
|
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
||||||
|
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package team.chisel.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovementInput;
|
||||||
|
import net.minecraft.util.MovementInputFromOptions;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
|
public class BlockCarvableConcreteStairs extends BlockCarvableStairs {
|
||||||
|
|
||||||
|
public BlockCarvableConcreteStairs(Block block, int meta, CarvableHelper helper) {
|
||||||
|
super(block, meta, helper);
|
||||||
|
|
||||||
|
FMLCommonHandler.instance()
|
||||||
|
.bus()
|
||||||
|
.register(new EventHandler());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override super's getSubBlocks to allow concrete's 11 variants
|
||||||
|
// Stairs are added to the list in pairs, so odd-numbered variant counts create
|
||||||
|
// a block that shouldn't exist. This modification makes the block unreachable by normal
|
||||||
|
// means (NEI, creative menu), but still technically exists in-game
|
||||||
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(Item block, CreativeTabs tabs, List list) {
|
||||||
|
list.add(new ItemStack(block, 1, 0));
|
||||||
|
|
||||||
|
// If odd# of variations && meta for the current block == variation.size - 1, exit
|
||||||
|
// Second check checks if the current block is at the end of the variation list
|
||||||
|
if (carverHelper.infoList.size() % 2 == 1 && this.blockMeta == carverHelper.infoList.size() - 1) return;
|
||||||
|
list.add(new ItemStack(block, 1, 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private static MovementInput manualInputCheck;
|
||||||
|
|
||||||
|
public class EventHandler {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void speedupPlayer(TickEvent.PlayerTickEvent event) {
|
||||||
|
if (event.phase == TickEvent.Phase.START && event.side.isClient()
|
||||||
|
&& event.player.onGround
|
||||||
|
&& event.player instanceof EntityPlayerSP) {
|
||||||
|
if (manualInputCheck == null) {
|
||||||
|
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||||
|
}
|
||||||
|
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||||
|
Block below = player.worldObj.getBlock(
|
||||||
|
MathHelper.floor_double(player.posX),
|
||||||
|
MathHelper.floor_double(player.posY) - 2,
|
||||||
|
MathHelper.floor_double(player.posZ));
|
||||||
|
|
||||||
|
if (below == BlockCarvableConcreteStairs.this) {
|
||||||
|
manualInputCheck.updatePlayerMoveState();
|
||||||
|
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||||
|
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
||||||
|
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package team.chisel.block;
|
package team.chisel.block;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockGlass;
|
import net.minecraft.block.BlockGlass;
|
||||||
@@ -12,8 +14,6 @@ import net.minecraft.util.IIcon;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import team.chisel.ctmlib.CTM;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
@@ -22,6 +22,7 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
|||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.ctmlib.CTM;
|
||||||
|
|
||||||
public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||||
|
|
||||||
@@ -63,7 +64,8 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
ForgeDirection face = ForgeDirection.getOrientation(side).getOpposite();
|
ForgeDirection face = ForgeDirection.getOrientation(side)
|
||||||
|
.getOpposite();
|
||||||
int meX = x + face.offsetX;
|
int meX = x + face.offsetX;
|
||||||
int meY = y + face.offsetY;
|
int meY = y + face.offsetY;
|
||||||
int meZ = z + face.offsetZ;
|
int meZ = z + face.offsetZ;
|
||||||
@@ -105,4 +107,9 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
|||||||
public int getRenderBlockPass() {
|
public int getRenderBlockPass() {
|
||||||
return isAlpha ? 1 : 0;
|
return isAlpha ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int quantityDropped(Random random) {
|
||||||
|
return Objects.equals(this.getUnlocalizedName(), "tile.chisel.technical2") ? 1 : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,10 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.client.render.SubmapManagerBase;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.client.render.SubmapManagerBase;
|
||||||
|
|
||||||
public class BlockCarvableGlow extends BlockCarvableColor {
|
public class BlockCarvableGlow extends BlockCarvableColor {
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ public class BlockCarvableGlowstone extends BlockCarvable {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDamageValue(World world, int x, int y, int z) {
|
||||||
|
return world.getBlockMetadata(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||||
Block glowstone = world.getBlock(x, y, z);
|
Block glowstone = world.getBlock(x, y, z);
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
|
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
public class BlockCarvableIceStairs extends BlockCarvableStairs {
|
public class BlockCarvableIceStairs extends BlockCarvableStairs {
|
||||||
|
|
||||||
public BlockCarvableIceStairs(Block block, int meta, CarvableHelper helper) {
|
public BlockCarvableIceStairs(Block block, int meta, CarvableHelper helper) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
|
||||||
public class BlockCarvableLayered extends BlockCarvable {
|
public class BlockCarvableLayered extends BlockCarvable {
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
|
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
public class BlockCarvablePackedIceStairs extends BlockCarvableStairs {
|
public class BlockCarvablePackedIceStairs extends BlockCarvableStairs {
|
||||||
|
|
||||||
public BlockCarvablePackedIceStairs(Block block, int meta, CarvableHelper helper) {
|
public BlockCarvablePackedIceStairs(Block block, int meta, CarvableHelper helper) {
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.client.render.RendererCTMPane;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
@@ -19,6 +17,7 @@ import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
|||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.client.render.RendererCTMPane;
|
||||||
|
|
||||||
public class BlockCarvablePane extends BlockPane implements ICarvable {
|
public class BlockCarvablePane extends BlockPane implements ICarvable {
|
||||||
|
|
||||||
|
|||||||
@@ -7,22 +7,14 @@ import net.minecraft.entity.monster.EntityIronGolem;
|
|||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.entity.EntityChiselSnowman;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.entity.EntityChiselSnowman;
|
||||||
|
|
||||||
public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
public class BlockCarvablePumpkin extends BlockPumpkin {
|
||||||
|
|
||||||
public CarvableHelper carverHelper;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon top, face;
|
private IIcon top, face;
|
||||||
@@ -33,7 +25,6 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
|||||||
super(isOn);
|
super(isOn);
|
||||||
this.setStepSound(Block.soundTypeWood);
|
this.setStepSound(Block.soundTypeWood);
|
||||||
if (isOn) setLightLevel(10.0F);
|
if (isOn) setLightLevel(10.0F);
|
||||||
carverHelper = new CarvableHelper(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -58,20 +49,20 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
|||||||
// Spawn some lovely particles
|
// Spawn some lovely particles
|
||||||
for (int c = 0; c < 120; ++c) {
|
for (int c = 0; c < 120; ++c) {
|
||||||
world.spawnParticle(
|
world.spawnParticle(
|
||||||
"snowshovel",
|
"snowshovel",
|
||||||
x + world.rand.nextDouble(),
|
x + world.rand.nextDouble(),
|
||||||
y - 2 + world.rand.nextDouble() * 2.5D,
|
y - 2 + world.rand.nextDouble() * 2.5D,
|
||||||
z + world.rand.nextDouble(),
|
z + world.rand.nextDouble(),
|
||||||
0.0D,
|
0.0D,
|
||||||
0.0D,
|
0.0D,
|
||||||
0.0D);
|
0.0D);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) {
|
if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) {
|
||||||
boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block
|
boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block
|
||||||
&& world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
|
&& world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
|
||||||
boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block
|
boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block
|
||||||
&& world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
|
&& world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
|
||||||
|
|
||||||
if (flag || flag1) {
|
if (flag || flag1) {
|
||||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||||
@@ -110,11 +101,10 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? top
|
return side == 1 ? top
|
||||||
: (side == 0 ? top
|
: (side == 0 ? top
|
||||||
: (meta == 2 && side == 2 ? face
|
: (meta == 2 && side == 2 ? face
|
||||||
: (meta == 3 && side == 5 ? face
|
: (meta == 3 && side == 5 ? face
|
||||||
: (meta == 0 && side == 3 ? face
|
: (meta == 0 && side == 3 ? face : (meta == 1 && side == 4 ? face : this.blockIcon)))));
|
||||||
: (meta == 1 && side == 4 ? face : this.blockIcon)))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -124,16 +114,6 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
|||||||
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":pumpkin/pumpkin_side");
|
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":pumpkin/pumpkin_side");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) {
|
|
||||||
return carverHelper.getVariation(metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IVariationInfo getManager(int meta) {
|
|
||||||
return carverHelper.getVariation(meta);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInformation(String textureLocation) {
|
public void setInformation(String textureLocation) {
|
||||||
this.faceLocation = textureLocation;
|
this.faceLocation = textureLocation;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.BlockSand;
|
import net.minecraft.block.BlockSand;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.EnumCreatureType;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
@@ -20,6 +19,8 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
|||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockCarvableSand extends BlockSand implements ICarvable {
|
public class BlockCarvableSand extends BlockSand implements ICarvable {
|
||||||
|
|
||||||
@@ -84,6 +85,11 @@ public class BlockCarvableSand extends BlockSand implements ICarvable {
|
|||||||
return carverHelper.getVariation(meta);
|
return carverHelper.getVariation(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||||
|
return Configurations.canMobsSpawnOnTheChiselBlocks;
|
||||||
|
}
|
||||||
|
|
||||||
public static class SoundType extends Block.SoundType {
|
public static class SoundType extends Block.SoundType {
|
||||||
|
|
||||||
public final String soundNameStep;
|
public final String soundNameStep;
|
||||||
@@ -133,7 +139,7 @@ public class BlockCarvableSand extends BlockSand implements ICarvable {
|
|||||||
* @param frequency default 1.0f
|
* @param frequency default 1.0f
|
||||||
*/
|
*/
|
||||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
||||||
float frequency) {
|
float frequency) {
|
||||||
super(soundNameStep, volume, frequency);
|
super(soundNameStep, volume, frequency);
|
||||||
this.soundNameStep = soundNameStep;
|
this.soundNameStep = soundNameStep;
|
||||||
this.soundNameBreak = soundNameBreak;
|
this.soundNameBreak = soundNameBreak;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class BlockCarvableSlab extends BlockCarvable {
|
|||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@Override
|
@Override
|
||||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
||||||
List par6List, Entity par7Entity) {
|
List par6List, Entity par7Entity) {
|
||||||
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
||||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.client.render.RendererStairs;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
|
|
||||||
|
import team.chisel.client.render.RendererStairs;
|
||||||
|
|
||||||
public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||||
|
|
||||||
CarvableHelper carverHelper;
|
CarvableHelper carverHelper;
|
||||||
@@ -40,7 +40,7 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int i) {
|
public int damageDropped(int i) {
|
||||||
return i / 8;
|
return i & 0x8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,7 +62,7 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
||||||
ItemStack par6ItemStack) {
|
ItemStack par6ItemStack) {
|
||||||
int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||||
|
|
||||||
// 0->2 2->3 3->0 1->1
|
// 0->2 2->3 3->0 1->1
|
||||||
|
|||||||
@@ -4,29 +4,22 @@ import java.util.Random;
|
|||||||
|
|
||||||
import net.minecraft.block.BlockTorch;
|
import net.minecraft.block.BlockTorch;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
|
||||||
public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
public class BlockCarvableTorch extends BlockTorch {
|
||||||
|
|
||||||
public CarvableHelper carverHelper;
|
|
||||||
private String texLocation;
|
private String texLocation;
|
||||||
protected boolean emitsParticles = true;
|
protected boolean emitsParticles = true;
|
||||||
public int idx;
|
public int idx;
|
||||||
|
|
||||||
public BlockCarvableTorch(int idx, String tex) {
|
public BlockCarvableTorch(int idx, String tex) {
|
||||||
super();
|
super();
|
||||||
carverHelper = new CarvableHelper(this);
|
|
||||||
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
||||||
setLightLevel(0.9375F);
|
setLightLevel(0.9375F);
|
||||||
setBlockName("torch");
|
setBlockName("torch");
|
||||||
@@ -34,16 +27,6 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
|||||||
this.texLocation = tex;
|
this.texLocation = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) {
|
|
||||||
return carverHelper.getVariation(metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IVariationInfo getManager(int meta) {
|
|
||||||
return carverHelper.getVariation(meta);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerBlockIcons(IIconRegister icon) {
|
public void registerBlockIcons(IIconRegister icon) {
|
||||||
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/" + texLocation);
|
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/" + texLocation);
|
||||||
@@ -57,7 +40,7 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_,
|
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_,
|
||||||
Random p_149734_5_) {
|
Random p_149734_5_) {
|
||||||
if (emitsParticles) {
|
if (emitsParticles) {
|
||||||
int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_);
|
int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_);
|
||||||
double d0 = p_149734_2_ + 0.5F;
|
double d0 = p_149734_2_ + 0.5F;
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.config.Configurations;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockCloud extends BlockCarvable {
|
public class BlockCloud extends BlockCarvable {
|
||||||
|
|
||||||
|
|||||||
@@ -7,43 +7,48 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.util.MovementInput;
|
import net.minecraft.util.MovementInput;
|
||||||
import net.minecraft.util.MovementInputFromOptions;
|
import net.minecraft.util.MovementInputFromOptions;
|
||||||
|
|
||||||
import team.chisel.config.Configurations;
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockConcrete extends BlockCarvable {
|
public class BlockConcrete extends BlockCarvable {
|
||||||
|
|
||||||
public BlockConcrete() {
|
public BlockConcrete() {
|
||||||
super();
|
super();
|
||||||
FMLCommonHandler.instance().bus().register(this);
|
FMLCommonHandler.instance()
|
||||||
|
.bus()
|
||||||
|
.register(new EventHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private static MovementInput manualInputCheck;
|
private static MovementInput manualInputCheck;
|
||||||
|
|
||||||
@SubscribeEvent
|
public class EventHandler {
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void speedupPlayer(PlayerTickEvent event) {
|
@SubscribeEvent
|
||||||
if (event.phase == Phase.START && event.side.isClient()
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void speedupPlayer(PlayerTickEvent event) {
|
||||||
|
if (event.phase == Phase.START && event.side.isClient()
|
||||||
&& event.player.onGround
|
&& event.player.onGround
|
||||||
&& event.player instanceof EntityPlayerSP) {
|
&& event.player instanceof EntityPlayerSP) {
|
||||||
if (manualInputCheck == null) {
|
if (manualInputCheck == null) {
|
||||||
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||||
}
|
}
|
||||||
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||||
Block below = player.worldObj.getBlock(
|
Block below = player.worldObj.getBlock(
|
||||||
MathHelper.floor_double(player.posX),
|
MathHelper.floor_double(player.posX),
|
||||||
MathHelper.floor_double(player.posY) - 2,
|
MathHelper.floor_double(player.posY) - 2,
|
||||||
MathHelper.floor_double(player.posZ));
|
MathHelper.floor_double(player.posZ));
|
||||||
if (below == this) {
|
if (below == BlockConcrete.this) {
|
||||||
manualInputCheck.updatePlayerMoveState();
|
manualInputCheck.updatePlayerMoveState();
|
||||||
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||||
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
||||||
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.EnumCreatureType;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
@@ -14,6 +15,8 @@ import com.cricketcraft.chisel.api.ICarvable;
|
|||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
|
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable {
|
public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable {
|
||||||
|
|
||||||
public CarvableHelper carverHelper;
|
public CarvableHelper carverHelper;
|
||||||
@@ -62,4 +65,9 @@ public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable {
|
|||||||
public IVariationInfo getManager(int meta) {
|
public IVariationInfo getManager(int meta) {
|
||||||
return carverHelper.getVariation(meta);
|
return carverHelper.getVariation(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||||
|
return Configurations.canMobsSpawnOnTheChiselBlocks;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraftforge.client.ForgeHooksClient;
|
|
||||||
|
|
||||||
import team.chisel.client.render.RendererMultiLayer;
|
import team.chisel.client.render.RendererMultiLayer;
|
||||||
|
|
||||||
@@ -43,7 +42,6 @@ public abstract class BlockMultiLayerBase extends Block {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRenderInPass(int pass) {
|
public boolean canRenderInPass(int pass) {
|
||||||
ForgeHooksClient.setRenderPass(pass);
|
|
||||||
return pass == 1 || pass == 0;
|
return pass == 1 || pass == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,14 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.block.tileentity.TileEntityPresent;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.block.tileentity.TileEntityPresent;
|
||||||
|
|
||||||
public class BlockPresent extends Block implements ICarvable {
|
public class BlockPresent extends Block implements ICarvable {
|
||||||
|
|
||||||
@@ -110,7 +109,7 @@ public class BlockPresent extends Block implements ICarvable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitX, float hitY,
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitX, float hitY,
|
||||||
float hitZ, float p_149727_9_) {
|
float hitZ, float p_149727_9_) {
|
||||||
if (!world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) {
|
if (!world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
player.openGui(Chisel.instance, 2, world, x, y, z);
|
player.openGui(Chisel.instance, 2, world, x, y, z);
|
||||||
@@ -143,22 +142,22 @@ public class BlockPresent extends Block implements ICarvable {
|
|||||||
ForgeDirection dir = me.getConnectionDir();
|
ForgeDirection dir = me.getConnectionDir();
|
||||||
// warning: magic below! Do not change this conditional
|
// warning: magic below! Do not change this conditional
|
||||||
if (dir == ForgeDirection.EAST || (me.isParent() && dir == ForgeDirection.SOUTH)
|
if (dir == ForgeDirection.EAST || (me.isParent() && dir == ForgeDirection.SOUTH)
|
||||||
|| (!me.isParent() && dir == ForgeDirection.SOUTH)) {
|
|| (!me.isParent() && dir == ForgeDirection.SOUTH)) {
|
||||||
return AxisAlignedBB.getBoundingBox(
|
return AxisAlignedBB.getBoundingBox(
|
||||||
x + minX,
|
x + minX,
|
||||||
y + minY,
|
y + minY,
|
||||||
z + minZ,
|
z + minZ,
|
||||||
x + maxX + dir.offsetX,
|
x + maxX + dir.offsetX,
|
||||||
y + maxY,
|
y + maxY,
|
||||||
z + maxZ + dir.offsetZ);
|
z + maxZ + dir.offsetZ);
|
||||||
} else {
|
} else {
|
||||||
return AxisAlignedBB.getBoundingBox(
|
return AxisAlignedBB.getBoundingBox(
|
||||||
x + dir.offsetX + minX,
|
x + dir.offsetX + minX,
|
||||||
y + minY,
|
y + minY,
|
||||||
z + dir.offsetZ + minZ,
|
z + dir.offsetZ + minZ,
|
||||||
x + maxX,
|
x + maxX,
|
||||||
y + maxY,
|
y + maxY,
|
||||||
z + maxZ);
|
z + maxZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
|
return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import net.minecraft.util.IIcon;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.config.Configurations;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockRoadLine extends BlockCarvable {
|
public class BlockRoadLine extends BlockCarvable {
|
||||||
|
|
||||||
@@ -53,7 +53,8 @@ public class BlockRoadLine extends BlockCarvable {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||||
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4)
|
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4)
|
||||||
|| par1World.getBlock(par2, par3 - 1, par4).equals(Blocks.glowstone);
|
|| par1World.getBlock(par2, par3 - 1, par4)
|
||||||
|
.equals(Blocks.glowstone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,7 +62,7 @@ public class BlockRoadLine extends BlockCarvable {
|
|||||||
if (par1World.isRemote) return;
|
if (par1World.isRemote) return;
|
||||||
|
|
||||||
if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) {
|
if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) {
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0);
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
par1World.setBlockToAir(par2, par3, par4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ public class BlockSnakestone extends Block {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!world.getBlock(x, y, z).equals(this)) continue;
|
if (!world.getBlock(x, y, z)
|
||||||
|
.equals(this)) continue;
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
|
|
||||||
int px1 = x, px2 = x;
|
int px1 = x, px2 = x;
|
||||||
@@ -250,17 +251,23 @@ public class BlockSnakestone extends Block {
|
|||||||
public boolean connectedTo(World par1World, int x, int y, int z, int direction) {
|
public boolean connectedTo(World par1World, int x, int y, int z, int direction) {
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case 0:
|
case 0:
|
||||||
return par1World.getBlock(x, y, z - 1).equals(this);
|
return par1World.getBlock(x, y, z - 1)
|
||||||
|
.equals(this);
|
||||||
case 1:
|
case 1:
|
||||||
return par1World.getBlock(x, y, z + 1).equals(this);
|
return par1World.getBlock(x, y, z + 1)
|
||||||
|
.equals(this);
|
||||||
case 2:
|
case 2:
|
||||||
return par1World.getBlock(x - 1, y, z).equals(this);
|
return par1World.getBlock(x - 1, y, z)
|
||||||
|
.equals(this);
|
||||||
case 3:
|
case 3:
|
||||||
return par1World.getBlock(x + 1, y, z).equals(this);
|
return par1World.getBlock(x + 1, y, z)
|
||||||
|
.equals(this);
|
||||||
case 4:
|
case 4:
|
||||||
return par1World.getBlock(x, y - 1, z).equals(this);
|
return par1World.getBlock(x, y - 1, z)
|
||||||
|
.equals(this);
|
||||||
case 5:
|
case 5:
|
||||||
return par1World.getBlock(x, y + 1, z).equals(this);
|
return par1World.getBlock(x, y + 1, z)
|
||||||
|
.equals(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package team.chisel.block;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import team.chisel.carving.Carving;
|
|
||||||
import team.chisel.item.ItemCarvable;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import team.chisel.carving.Carving;
|
||||||
|
import team.chisel.item.ItemCarvable;
|
||||||
|
|
||||||
public class CarvableStairsMaker {
|
public class CarvableStairsMaker {
|
||||||
|
|
||||||
@@ -29,20 +29,21 @@ public class CarvableStairsMaker {
|
|||||||
for (int i = 0; i < blocks.length; i++) {
|
for (int i = 0; i < blocks.length; i++) {
|
||||||
String n = name + "." + i;
|
String n = name + "." + i;
|
||||||
blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper)
|
blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper)
|
||||||
: creator.create(blockBase, i * 2, carverHelper);
|
: creator.create(blockBase, i * 2, carverHelper);
|
||||||
|
|
||||||
blocks[i].setBlockName("chisel." + n).setCreativeTab(ChiselTabs.tabStairChiselBlocks);
|
blocks[i].setBlockName("chisel." + n)
|
||||||
|
.setCreativeTab(ChiselTabs.tabStairChiselBlocks);
|
||||||
GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);
|
GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);
|
||||||
|
|
||||||
for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) {
|
for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) {
|
||||||
Carving.chisel.addVariation(name, CarvingUtils.getDefaultVariationFor(blocks[i], meta * 8, i));
|
Carving.chisel.addVariation(name, CarvingUtils.getDefaultVariationFor(blocks[i], meta * 8, i));
|
||||||
GameRegistry.addRecipe(
|
GameRegistry.addRecipe(
|
||||||
new ItemStack(blocks[i], 4, meta * 8),
|
new ItemStack(blocks[i], 4, meta * 8),
|
||||||
"* ",
|
"* ",
|
||||||
"** ",
|
"** ",
|
||||||
"***",
|
"***",
|
||||||
'*',
|
'*',
|
||||||
new ItemStack(blockBase, 1, i * 2 + meta));
|
new ItemStack(blockBase, 1, i * 2 + meta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package team.chisel.block.tileentity;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -15,6 +14,10 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.IChiselItem;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.Features;
|
import team.chisel.Features;
|
||||||
import team.chisel.carving.Carving;
|
import team.chisel.carving.Carving;
|
||||||
import team.chisel.client.GeneralChiselClient;
|
import team.chisel.client.GeneralChiselClient;
|
||||||
@@ -24,11 +27,6 @@ import team.chisel.network.message.MessageAutoChisel;
|
|||||||
import team.chisel.network.message.MessageSlotUpdate;
|
import team.chisel.network.message.MessageSlotUpdate;
|
||||||
import team.chisel.utils.General;
|
import team.chisel.utils.General;
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.IChiselItem;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory {
|
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory {
|
||||||
|
|
||||||
public enum Upgrade {
|
public enum Upgrade {
|
||||||
@@ -38,17 +36,23 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
STACK,
|
STACK,
|
||||||
REVERSION;
|
REVERSION;
|
||||||
|
|
||||||
|
public static final Upgrade[] VALUES = values();
|
||||||
|
|
||||||
public String getUnlocalizedName() {
|
public String getUnlocalizedName() {
|
||||||
if (Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
if (Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
||||||
return "item.upgrade_" + this.name().toLowerCase();
|
return "item.upgrade_" + this.name()
|
||||||
|
.toLowerCase();
|
||||||
}
|
}
|
||||||
return "chisel.autochisel.upgrade.disabled";
|
return "chisel.autochisel.upgrade.disabled";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocalizedName() {
|
public String getLocalizedName() {
|
||||||
String ret = StatCollector.translateToLocal("autochisel.slot." + this.name().toLowerCase() + ".tooltip");
|
String ret = StatCollector.translateToLocal(
|
||||||
|
"autochisel.slot." + this.name()
|
||||||
|
.toLowerCase() + ".tooltip");
|
||||||
if (!Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
if (!Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
||||||
ret = EnumChatFormatting.RED.toString().concat(ret);
|
ret = EnumChatFormatting.RED.toString()
|
||||||
|
.concat(ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -59,7 +63,6 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
|
|
||||||
private int progress = 0;
|
private int progress = 0;
|
||||||
|
|
||||||
private static EntityItem ghostItem;
|
|
||||||
boolean equal = false;
|
boolean equal = false;
|
||||||
private ItemStack[] inventory = new ItemStack[8];
|
private ItemStack[] inventory = new ItemStack[8];
|
||||||
private String name = "autoChisel";
|
private String name = "autoChisel";
|
||||||
@@ -227,12 +230,12 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ((IChiselItem) inventory[CHISEL].getItem())
|
return ((IChiselItem) inventory[CHISEL].getItem())
|
||||||
.canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget()));
|
.canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasChisel() {
|
private boolean hasChisel() {
|
||||||
return inventory[CHISEL] != null && inventory[CHISEL].getItem() instanceof IChiselItem
|
return inventory[CHISEL] != null && inventory[CHISEL].getItem() instanceof IChiselItem
|
||||||
&& inventory[CHISEL].stackSize >= 1;
|
&& inventory[CHISEL].stackSize >= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Calls IChiselItem#onChisel() and sends the chisel packet for sound/animation */
|
/** Calls IChiselItem#onChisel() and sends the chisel packet for sound/animation */
|
||||||
@@ -240,7 +243,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
if (!worldObj.isRemote) {
|
if (!worldObj.isRemote) {
|
||||||
boolean breakChisel = false;
|
boolean breakChisel = false;
|
||||||
if (((IChiselItem) inventory[CHISEL].getItem())
|
if (((IChiselItem) inventory[CHISEL].getItem())
|
||||||
.onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) {
|
.onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) {
|
||||||
inventory[CHISEL].setItemDamage(inventory[CHISEL].getItemDamage() + 1);
|
inventory[CHISEL].setItemDamage(inventory[CHISEL].getItemDamage() + 1);
|
||||||
if (inventory[CHISEL].getItemDamage() >= inventory[CHISEL].getMaxDamage()) {
|
if (inventory[CHISEL].getItemDamage() >= inventory[CHISEL].getMaxDamage()) {
|
||||||
setInventorySlotContents(CHISEL, null);
|
setInventorySlotContents(CHISEL, null);
|
||||||
@@ -248,18 +251,18 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PacketHandler.INSTANCE.sendToDimension(
|
PacketHandler.INSTANCE.sendToDimension(
|
||||||
new MessageAutoChisel(this, chiseled, true, breakChisel),
|
new MessageAutoChisel(this, chiseled, true, breakChisel),
|
||||||
worldObj.provider.dimensionId);
|
worldObj.provider.dimensionId);
|
||||||
} else {
|
} else {
|
||||||
if (breakChisel) {
|
if (breakChisel) {
|
||||||
worldObj.playSound(
|
worldObj.playSound(
|
||||||
xCoord + 0.5,
|
xCoord + 0.5,
|
||||||
yCoord + 0.5,
|
yCoord + 0.5,
|
||||||
zCoord + 0.5,
|
zCoord + 0.5,
|
||||||
"random.break",
|
"random.break",
|
||||||
0.8F,
|
0.8F,
|
||||||
0.8F + worldObj.rand.nextFloat() * 0.4F,
|
0.8F + worldObj.rand.nextFloat() * 0.4F,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
GeneralChiselClient.spawnAutoChiselFX(this, lastBase != null ? lastBase : inventory[BASE]);
|
GeneralChiselClient.spawnAutoChiselFX(this, lastBase != null ? lastBase : inventory[BASE]);
|
||||||
chiseling = false;
|
chiseling = false;
|
||||||
@@ -331,7 +334,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
|
|
||||||
private void slotChanged(int slot) {
|
private void slotChanged(int slot) {
|
||||||
PacketHandler.INSTANCE
|
PacketHandler.INSTANCE
|
||||||
.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId);
|
.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId);
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,14 +372,15 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
switch (slot) {
|
switch (slot) {
|
||||||
case BASE:
|
case BASE:
|
||||||
case TARGET:
|
case TARGET:
|
||||||
return !Carving.chisel.getItemsForChiseling(itemStack).isEmpty();
|
return !Carving.chisel.getItemsForChiseling(itemStack)
|
||||||
|
.isEmpty();
|
||||||
case OUTPUT:
|
case OUTPUT:
|
||||||
return false;
|
return false;
|
||||||
case CHISEL:
|
case CHISEL:
|
||||||
return itemStack.getItem() instanceof IChiselItem;
|
return itemStack.getItem() instanceof IChiselItem;
|
||||||
default:
|
default:
|
||||||
return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade
|
return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade
|
||||||
&& Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
|
&& Upgrade.VALUES[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,27 +405,15 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public EntityItem getItemForRendering(int slot) {
|
public ItemStack getItemForRendering(int slot) {
|
||||||
if (ghostItem == null) {
|
|
||||||
ghostItem = new EntityItem(worldObj);
|
|
||||||
ghostItem.hoverStart = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (slot == BASE && lastBase != null) {
|
if (slot == BASE && lastBase != null) {
|
||||||
ghostItem.setEntityItemStack(lastBase.copy());
|
return lastBase.copy();
|
||||||
return ghostItem;
|
|
||||||
} else if (slot == TARGET) {
|
} else if (slot == TARGET) {
|
||||||
ItemStack target = getTarget();
|
return getTarget();
|
||||||
if (target != null) {
|
|
||||||
ghostItem.setEntityItemStack(target);
|
|
||||||
return ghostItem;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
} else if (inventory[slot] == null) {
|
} else if (inventory[slot] == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
ghostItem.setEntityItemStack(inventory[slot].copy());
|
return inventory[slot].copy();
|
||||||
return ghostItem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,7 +453,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
String unloc = name == null ? null : String.format(base, name);
|
String unloc = name == null ? null : String.format(base, name);
|
||||||
return StatCollector.translateToLocal(unloc);
|
return StatCollector.translateToLocal(unloc);
|
||||||
} else {
|
} else {
|
||||||
return Upgrade.values()[slotNumber - MIN_UPGRADE].getLocalizedName();
|
return Upgrade.VALUES[slotNumber - MIN_UPGRADE].getLocalizedName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
|||||||
|
|
||||||
private boolean connectTo(TileEntityPresent present, ForgeDirection dir) {
|
private boolean connectTo(TileEntityPresent present, ForgeDirection dir) {
|
||||||
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected()
|
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected()
|
||||||
&& (present.cachedDir == null || present.cachedDir == dir.getOpposite())
|
&& (present.cachedDir == null || present.cachedDir == dir.getOpposite())
|
||||||
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
|
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
|
||||||
connection = present;
|
connection = present;
|
||||||
connection.connection = this;
|
connection.connection = this;
|
||||||
connection.cachedDir = dir.getOpposite();
|
connection.cachedDir = dir.getOpposite();
|
||||||
@@ -57,7 +57,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
|||||||
isParent = !present.isParent;
|
isParent = !present.isParent;
|
||||||
markDirty();
|
markDirty();
|
||||||
PacketHandler.INSTANCE
|
PacketHandler.INSTANCE
|
||||||
.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId);
|
.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -87,8 +87,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
|||||||
this.connection = null;
|
this.connection = null;
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
PacketHandler.INSTANCE.sendToDimension(
|
PacketHandler.INSTANCE.sendToDimension(
|
||||||
new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir),
|
new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir),
|
||||||
worldObj.provider.dimensionId);
|
worldObj.provider.dimensionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y,
|
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y,
|
||||||
int z) {
|
int z) {
|
||||||
// prevent losing TE data when in-world chiseling
|
// prevent losing TE data when in-world chiseling
|
||||||
return oldBlock != newBlock;
|
return oldBlock != newBlock;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
package team.chisel.carving;
|
package team.chisel.carving;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||||
|
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
|
||||||
public class Carving implements ICarvingRegistry {
|
public class Carving implements ICarvingRegistry {
|
||||||
|
|
||||||
GroupList groups = new GroupList();
|
GroupList groups = new GroupList();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class GroupList implements Set<ICarvingGroup> {
|
|||||||
if (obj instanceof ICarvingVariation) {
|
if (obj instanceof ICarvingVariation) {
|
||||||
ICarvingVariation v2 = (ICarvingVariation) obj;
|
ICarvingVariation v2 = (ICarvingVariation) obj;
|
||||||
return v.getBlock() == v2.getBlock()
|
return v.getBlock() == v2.getBlock()
|
||||||
&& (v.getBlockMeta() == v2.getBlockMeta() || v.getItemMeta() == v2.getItemMeta());
|
&& (v.getBlockMeta() == v2.getBlockMeta() || v.getItemMeta() == v2.getItemMeta());
|
||||||
} else if (obj instanceof VariationWrapper) {
|
} else if (obj instanceof VariationWrapper) {
|
||||||
return equals(((VariationWrapper) obj).v);
|
return equals(((VariationWrapper) obj).v);
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,8 @@ public class GroupList implements Set<ICarvingGroup> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return v.getBlock().hashCode();
|
return v.getBlock()
|
||||||
|
.hashCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,17 +101,20 @@ public class GroupList implements Set<ICarvingGroup> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<ICarvingGroup> iterator() {
|
public Iterator<ICarvingGroup> iterator() {
|
||||||
return groups.values().iterator();
|
return groups.values()
|
||||||
|
.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object[] toArray() {
|
public Object[] toArray() {
|
||||||
return groups.values().toArray();
|
return groups.values()
|
||||||
|
.toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T[] toArray(T[] arr) {
|
public <T> T[] toArray(T[] arr) {
|
||||||
return groups.values().toArray(arr);
|
return groups.values()
|
||||||
|
.toArray(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -134,7 +138,9 @@ public class GroupList implements Set<ICarvingGroup> {
|
|||||||
if (o instanceof ICarvingGroup) {
|
if (o instanceof ICarvingGroup) {
|
||||||
List<VariationWrapper> toRemove = Lists.newArrayList();
|
List<VariationWrapper> toRemove = Lists.newArrayList();
|
||||||
for (VariationWrapper v : lookup.keySet()) {
|
for (VariationWrapper v : lookup.keySet()) {
|
||||||
if (lookup.get(v).getName().equals(((ICarvingGroup) o).getName())) {
|
if (lookup.get(v)
|
||||||
|
.getName()
|
||||||
|
.equals(((ICarvingGroup) o).getName())) {
|
||||||
toRemove.add(v);
|
toRemove.add(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,9 +234,11 @@ public class GroupList implements Set<ICarvingGroup> {
|
|||||||
}
|
}
|
||||||
List<VariationWrapper> toRemove = Lists.newArrayList();
|
List<VariationWrapper> toRemove = Lists.newArrayList();
|
||||||
for (VariationWrapper v : lookup.keySet()) {
|
for (VariationWrapper v : lookup.keySet()) {
|
||||||
if ((g == null || lookup.get(v).getName().equals(g.getName()))
|
if ((g == null || lookup.get(v)
|
||||||
&& v.equals(new VariationWrapper(new VariationKey(block, metadata)))) {
|
.getName()
|
||||||
lookup.get(v).removeVariation(v.v);
|
.equals(g.getName())) && v.equals(new VariationWrapper(new VariationKey(block, metadata)))) {
|
||||||
|
lookup.get(v)
|
||||||
|
.removeVariation(v.v);
|
||||||
toRemove.add(v);
|
toRemove.add(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,19 +30,18 @@ public class GeneralChiselClient {
|
|||||||
|
|
||||||
public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) {
|
public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) {
|
||||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0
|
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0
|
||||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) return;
|
||||||
return;
|
|
||||||
|
|
||||||
float f = 0.15F;
|
float f = 0.15F;
|
||||||
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinX();
|
+ block.getBlockBoundsMinX();
|
||||||
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinY();
|
+ block.getBlockBoundsMinY();
|
||||||
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinZ();
|
+ block.getBlockBoundsMinZ();
|
||||||
|
|
||||||
switch (rand.nextInt(6)) {
|
switch (rand.nextInt(6)) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -71,7 +70,8 @@ public class GeneralChiselClient {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getBlock(x, y, z).isOpaqueCube()) return;
|
if (world.getBlock(x, y, z)
|
||||||
|
.isOpaqueCube()) return;
|
||||||
|
|
||||||
EntityLavaFX res = new EntityLavaFX(world, x1, y1, z1);
|
EntityLavaFX res = new EntityLavaFX(world, x1, y1, z1);
|
||||||
double multiplier = 0.45;
|
double multiplier = 0.45;
|
||||||
@@ -84,19 +84,18 @@ public class GeneralChiselClient {
|
|||||||
|
|
||||||
public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) {
|
public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) {
|
||||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0
|
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0
|
||||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) return;
|
||||||
return;
|
|
||||||
|
|
||||||
float f = 0.15F;
|
float f = 0.15F;
|
||||||
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinX();
|
+ block.getBlockBoundsMinX();
|
||||||
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinY();
|
+ block.getBlockBoundsMinY();
|
||||||
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinZ();
|
+ block.getBlockBoundsMinZ();
|
||||||
|
|
||||||
switch (rand.nextInt(6)) {
|
switch (rand.nextInt(6)) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -125,7 +124,8 @@ public class GeneralChiselClient {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getBlock(x, y, z).isOpaqueCube()) return;
|
if (world.getBlock(x, y, z)
|
||||||
|
.isOpaqueCube()) return;
|
||||||
|
|
||||||
EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1);
|
EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1);
|
||||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||||
@@ -136,14 +136,14 @@ public class GeneralChiselClient {
|
|||||||
|
|
||||||
float f = 0.15F;
|
float f = 0.15F;
|
||||||
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinX();
|
+ block.getBlockBoundsMinX();
|
||||||
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinY();
|
+ block.getBlockBoundsMinY();
|
||||||
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinZ();
|
+ block.getBlockBoundsMinZ();
|
||||||
|
|
||||||
switch (rand.nextInt(6)) {
|
switch (rand.nextInt(6)) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -172,7 +172,8 @@ public class GeneralChiselClient {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getBlock(x, y, z).isOpaqueCube()) return;
|
if (world.getBlock(x, y, z)
|
||||||
|
.isOpaqueCube()) return;
|
||||||
|
|
||||||
EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1);
|
EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1);
|
||||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||||
@@ -180,7 +181,7 @@ public class GeneralChiselClient {
|
|||||||
|
|
||||||
public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) {
|
public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) {
|
||||||
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0
|
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0
|
||||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||||
EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z);
|
EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z);
|
||||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||||
}
|
}
|
||||||
@@ -188,7 +189,7 @@ public class GeneralChiselClient {
|
|||||||
|
|
||||||
public static void spawnBallOMossFX(World world, double x, double y, double z) {
|
public static void spawnBallOMossFX(World world, double x, double y, double z) {
|
||||||
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0
|
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0
|
||||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||||
EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z);
|
EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z);
|
||||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||||
}
|
}
|
||||||
@@ -202,14 +203,14 @@ public class GeneralChiselClient {
|
|||||||
|
|
||||||
float f = 0.1F;
|
float f = 0.1F;
|
||||||
double d0 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
double d0 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinX();
|
+ block.getBlockBoundsMinX();
|
||||||
double d1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
double d1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinY();
|
+ block.getBlockBoundsMinY();
|
||||||
double d2 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
double d2 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||||
+ f
|
+ f
|
||||||
+ block.getBlockBoundsMinZ();
|
+ block.getBlockBoundsMinZ();
|
||||||
|
|
||||||
switch (side) {
|
switch (side) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -233,16 +234,16 @@ public class GeneralChiselClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EntityDiggingFX res = new EntityDiggingFX(
|
EntityDiggingFX res = new EntityDiggingFX(
|
||||||
world,
|
world,
|
||||||
d0,
|
d0,
|
||||||
d1,
|
d1,
|
||||||
d2,
|
d2,
|
||||||
0.0D,
|
0.0D,
|
||||||
0.0D,
|
0.0D,
|
||||||
0.0D,
|
0.0D,
|
||||||
block,
|
block,
|
||||||
world.getBlockMetadata(x, y, z),
|
world.getBlockMetadata(x, y, z),
|
||||||
side);
|
side);
|
||||||
res.motionX = d0 - (x + 0.5);
|
res.motionX = d0 - (x + 0.5);
|
||||||
res.motionY = d1 - (y + 0.5);
|
res.motionY = d1 - (y + 0.5);
|
||||||
res.motionZ = d2 - (z + 0.5);
|
res.motionZ = d2 - (z + 0.5);
|
||||||
@@ -271,19 +272,19 @@ public class GeneralChiselClient {
|
|||||||
if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) {
|
if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) {
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
EntityDiggingFX particle = new EntityDiggingFX(
|
EntityDiggingFX particle = new EntityDiggingFX(
|
||||||
te.getWorldObj(),
|
te.getWorldObj(),
|
||||||
te.xCoord + 0.5,
|
te.xCoord + 0.5,
|
||||||
te.yCoord + 0.95,
|
te.yCoord + 0.95,
|
||||||
te.zCoord + 0.5,
|
te.zCoord + 0.5,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
Block.getBlockFromItem(base.getItem()),
|
Block.getBlockFromItem(base.getItem()),
|
||||||
base.getItemDamage());
|
base.getItemDamage());
|
||||||
particle.setVelocity(
|
particle.setVelocity(
|
||||||
(te.getWorldObj().rand.nextDouble() / 4) - 0.125,
|
(te.getWorldObj().rand.nextDouble() / 4) - 0.125,
|
||||||
te.getWorldObj().rand.nextDouble() / 8,
|
te.getWorldObj().rand.nextDouble() / 8,
|
||||||
(te.getWorldObj().rand.nextDouble() / 4) - 0.125);
|
(te.getWorldObj().rand.nextDouble() / 4) - 0.125);
|
||||||
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
|
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
|
||||||
}
|
}
|
||||||
String sound = Carving.chisel.getVariationSound(base.getItem(), base.getItemDamage());
|
String sound = Carving.chisel.getVariationSound(base.getItem(), base.getItemDamage());
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import net.minecraft.util.ResourceLocation;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
|
||||||
import team.chisel.inventory.ContainerAutoChisel;
|
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||||
|
import team.chisel.inventory.ContainerAutoChisel;
|
||||||
|
|
||||||
public class GuiAutoChisel extends GuiContainer {
|
public class GuiAutoChisel extends GuiContainer {
|
||||||
|
|
||||||
private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png");
|
private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png");
|
||||||
@@ -55,8 +55,8 @@ public class GuiAutoChisel extends GuiContainer {
|
|||||||
|
|
||||||
private boolean mouseInside(Slot slot, int x, int y) {
|
private boolean mouseInside(Slot slot, int x, int y) {
|
||||||
return x >= slot.xDisplayPosition && x <= slot.xDisplayPosition + 16
|
return x >= slot.xDisplayPosition && x <= slot.xDisplayPosition + 16
|
||||||
&& y >= slot.yDisplayPosition
|
&& y >= slot.yDisplayPosition
|
||||||
&& y <= slot.yDisplayPosition + 16;
|
&& y <= slot.yDisplayPosition + 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -81,11 +81,11 @@ public class GuiAutoChisel extends GuiContainer {
|
|||||||
public static void drawSlotOverlay(GuiContainer gui, int x, int y, Slot slot, int u, int v, int padding) {
|
public static void drawSlotOverlay(GuiContainer gui, int x, int y, Slot slot, int u, int v, int padding) {
|
||||||
padding /= 2;
|
padding /= 2;
|
||||||
gui.drawTexturedModalRect(
|
gui.drawTexturedModalRect(
|
||||||
x + (slot.xDisplayPosition - padding),
|
x + (slot.xDisplayPosition - padding),
|
||||||
y + (slot.yDisplayPosition - padding),
|
y + (slot.yDisplayPosition - padding),
|
||||||
u,
|
u,
|
||||||
v,
|
v,
|
||||||
18 + padding,
|
18 + padding,
|
||||||
18 + padding);
|
18 + padding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,12 @@ import net.minecraft.util.ResourceLocation;
|
|||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.IAdvancedChisel;
|
||||||
|
import com.cricketcraft.chisel.api.IChiselItem;
|
||||||
|
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.client.gui.widgets.GuiButtonChiselMode;
|
import team.chisel.client.gui.widgets.GuiButtonChiselMode;
|
||||||
import team.chisel.inventory.ContainerChisel;
|
import team.chisel.inventory.ContainerChisel;
|
||||||
import team.chisel.inventory.InventoryChiselSelection;
|
import team.chisel.inventory.InventoryChiselSelection;
|
||||||
@@ -23,19 +29,12 @@ import team.chisel.network.PacketHandler;
|
|||||||
import team.chisel.network.message.MessageChiselMode;
|
import team.chisel.network.message.MessageChiselMode;
|
||||||
import team.chisel.utils.General;
|
import team.chisel.utils.General;
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.IAdvancedChisel;
|
|
||||||
import com.cricketcraft.chisel.api.IChiselItem;
|
|
||||||
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiChisel extends GuiContainer {
|
public class GuiChisel extends GuiContainer {
|
||||||
|
|
||||||
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(
|
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(
|
||||||
MOD_ID,
|
MOD_ID,
|
||||||
"textures/chisel2GuiScroll.png");
|
"textures/chisel2GuiScroll.png");
|
||||||
public static final int TEXTURE_WIDTH = 266;
|
public static final int TEXTURE_WIDTH = 266;
|
||||||
public static final int TEXTURE_HEIGHT = 250;
|
public static final int TEXTURE_HEIGHT = 250;
|
||||||
public static final int GUI_WIDTH = 266;
|
public static final int GUI_WIDTH = 266;
|
||||||
@@ -91,7 +90,7 @@ public class GuiChisel extends GuiContainer {
|
|||||||
|
|
||||||
private boolean showMode() {
|
private boolean showMode() {
|
||||||
return container.chisel != null && container.chisel.getItem() instanceof IChiselItem
|
return container.chisel != null && container.chisel.getItem() instanceof IChiselItem
|
||||||
&& ((IChiselItem) container.chisel.getItem()).hasModes(container.chisel);
|
&& ((IChiselItem) container.chisel.getItem()).hasModes(container.chisel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -100,15 +99,15 @@ public class GuiChisel extends GuiContainer {
|
|||||||
|
|
||||||
final String titleText = I18n.format(container.inventory.getInventoryName() + ".title");
|
final String titleText = I18n.format(container.inventory.getInventoryName() + ".title");
|
||||||
fontRendererObj
|
fontRendererObj
|
||||||
.drawSplitString(titleText, 50 - fontRendererObj.getStringWidth(titleText) / 2, 60, 40, 0x404040);
|
.drawSplitString(titleText, 50 - fontRendererObj.getStringWidth(titleText) / 2, 60, 40, 0x404040);
|
||||||
|
|
||||||
if (showMode()) {
|
if (showMode()) {
|
||||||
final String modeText = I18n.format(container.inventory.getInventoryName() + ".mode");
|
final String modeText = I18n.format(container.inventory.getInventoryName() + ".mode");
|
||||||
fontRendererObj.drawString(
|
fontRendererObj.drawString(
|
||||||
modeText,
|
modeText,
|
||||||
12 + (GuiButtonChiselMode.BUTTON_WIDTH - fontRendererObj.getStringWidth(modeText)) / 2,
|
12 + (GuiButtonChiselMode.BUTTON_WIDTH - fontRendererObj.getStringWidth(modeText)) / 2,
|
||||||
122,
|
122,
|
||||||
0x404040);
|
0x404040);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollBar.draw(this);
|
scrollBar.draw(this);
|
||||||
@@ -119,21 +118,22 @@ public class GuiChisel extends GuiContainer {
|
|||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION);
|
mc.getTextureManager()
|
||||||
|
.bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||||
// drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight
|
// drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight
|
||||||
func_146110_a(guiLeft, guiTop, 0, 0, xSize, ySize, TEXTURE_WIDTH, TEXTURE_HEIGHT);
|
func_146110_a(guiLeft, guiTop, 0, 0, xSize, ySize, TEXTURE_WIDTH, TEXTURE_HEIGHT);
|
||||||
|
|
||||||
Slot main = (Slot) container.inventorySlots.get(InventoryChiselSelection.normalSlots);
|
Slot main = (Slot) container.inventorySlots.get(InventoryChiselSelection.normalSlots);
|
||||||
if (main.getStack() == null) {
|
if (main.getStack() == null) {
|
||||||
func_146110_a(
|
func_146110_a(
|
||||||
guiLeft + 8,
|
guiLeft + 8,
|
||||||
guiTop + 8,
|
guiTop + 8,
|
||||||
0,
|
0,
|
||||||
GUI_HEIGHT,
|
GUI_HEIGHT,
|
||||||
CHISEL_INPUT_SIZE,
|
CHISEL_INPUT_SIZE,
|
||||||
CHISEL_INPUT_SIZE,
|
CHISEL_INPUT_SIZE,
|
||||||
TEXTURE_WIDTH,
|
TEXTURE_WIDTH,
|
||||||
TEXTURE_HEIGHT);
|
TEXTURE_HEIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,20 +5,20 @@ import net.minecraftforge.common.config.ConfigCategory;
|
|||||||
import net.minecraftforge.common.config.ConfigElement;
|
import net.minecraftforge.common.config.ConfigElement;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.config.GuiConfig;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.config.Configurations;
|
import team.chisel.config.Configurations;
|
||||||
import cpw.mods.fml.client.config.GuiConfig;
|
|
||||||
|
|
||||||
public class GuiChiselConfig extends GuiConfig {
|
public class GuiChiselConfig extends GuiConfig {
|
||||||
|
|
||||||
public GuiChiselConfig(GuiScreen parent) {
|
public GuiChiselConfig(GuiScreen parent) {
|
||||||
super(
|
super(
|
||||||
parent,
|
parent,
|
||||||
new ConfigElement<ConfigCategory>(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL))
|
new ConfigElement<ConfigCategory>(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL))
|
||||||
.getChildElements(),
|
.getChildElements(),
|
||||||
Chisel.MOD_ID,
|
Chisel.MOD_ID,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
GuiConfig.getAbridgedConfigPath(Configurations.config.toString()));
|
GuiConfig.getAbridgedConfigPath(Configurations.config.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,8 @@ public class GuiPresent extends GuiContainer {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
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);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(gui);
|
this.mc.getTextureManager()
|
||||||
|
.bindTexture(gui);
|
||||||
int x = (this.width - this.xSize) / 2;
|
int x = (this.width - this.xSize) / 2;
|
||||||
int y = (this.height - this.ySize) / 2;
|
int y = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.rows * 18 + 17);
|
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.rows * 18 + 17);
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import team.chisel.network.message.MessageScrollUpdate;
|
|||||||
public class GuiScrollbar {
|
public class GuiScrollbar {
|
||||||
|
|
||||||
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(
|
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(
|
||||||
"minecraft",
|
"minecraft",
|
||||||
"textures/gui/container/creative_inventory/tabs.png");
|
"textures/gui/container/creative_inventory/tabs.png");
|
||||||
|
|
||||||
private int displayX = 0;
|
private int displayX = 0;
|
||||||
private int displayY = 0;
|
private int displayY = 0;
|
||||||
@@ -28,7 +28,8 @@ public class GuiScrollbar {
|
|||||||
public void draw(GuiChisel g) {
|
public void draw(GuiChisel g) {
|
||||||
// chisel2GuiScroll scroll button texture coordinates work strange (maybe because of alignment) so taking
|
// chisel2GuiScroll scroll button texture coordinates work strange (maybe because of alignment) so taking
|
||||||
// vanilla one
|
// vanilla one
|
||||||
g.mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION);
|
g.mc.getTextureManager()
|
||||||
|
.bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
|
|
||||||
if (getMaxScroll() == 0) {
|
if (getMaxScroll() == 0) {
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
package team.chisel.client.gui.widgets;
|
package team.chisel.client.gui.widgets;
|
||||||
|
|
||||||
import static team.chisel.client.gui.GuiChisel.*;
|
import static team.chisel.client.gui.GuiChisel.TEXTURE_HEIGHT;
|
||||||
|
import static team.chisel.client.gui.GuiChisel.TEXTURE_RESOURCE_LOCATION;
|
||||||
|
import static team.chisel.client.gui.GuiChisel.TEXTURE_WIDTH;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.client.gui.GuiChisel;
|
|
||||||
import team.chisel.item.chisel.ChiselMode;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.client.gui.GuiChisel;
|
||||||
|
import team.chisel.item.chisel.ChiselMode;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiButtonChiselMode extends GuiButton {
|
public class GuiButtonChiselMode extends GuiButton {
|
||||||
@@ -42,12 +44,13 @@ public class GuiButtonChiselMode extends GuiButton {
|
|||||||
@Override
|
@Override
|
||||||
public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) {
|
public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) {
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION);
|
mc.getTextureManager()
|
||||||
|
.bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
// Mouse Hover State
|
// Mouse Hover State
|
||||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||||
&& mouseX < this.xPosition + this.width
|
&& mouseX < this.xPosition + this.width
|
||||||
&& mouseY < this.yPosition + this.height;
|
&& mouseY < this.yPosition + this.height;
|
||||||
drawButtonBackgroundLayer();
|
drawButtonBackgroundLayer();
|
||||||
drawButtonForegroundLayer();
|
drawButtonForegroundLayer();
|
||||||
}
|
}
|
||||||
@@ -57,14 +60,14 @@ public class GuiButtonChiselMode extends GuiButton {
|
|||||||
final float u = BUTTON_BACKGROUND_U + (this.field_146123_n ? BUTTON_WIDTH : 0);
|
final float u = BUTTON_BACKGROUND_U + (this.field_146123_n ? BUTTON_WIDTH : 0);
|
||||||
// drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight
|
// drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight
|
||||||
func_146110_a(
|
func_146110_a(
|
||||||
this.xPosition,
|
this.xPosition,
|
||||||
this.yPosition,
|
this.yPosition,
|
||||||
u,
|
u,
|
||||||
BUTTON_BACKGROUND_V,
|
BUTTON_BACKGROUND_V,
|
||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
TEXTURE_WIDTH,
|
TEXTURE_WIDTH,
|
||||||
TEXTURE_HEIGHT);
|
TEXTURE_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawButtonForegroundLayer() {
|
private void drawButtonForegroundLayer() {
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package team.chisel.client.render;
|
||||||
|
|
||||||
|
import codechicken.lib.render.CCRenderState;
|
||||||
|
|
||||||
|
public class FullBrightLighting implements CCRenderState.IVertexOperation {
|
||||||
|
|
||||||
|
public static FullBrightLighting instance = new FullBrightLighting();
|
||||||
|
public int id;
|
||||||
|
|
||||||
|
public boolean load() {
|
||||||
|
final CCRenderState state = CCRenderState.instance();
|
||||||
|
|
||||||
|
if (!state.computeLighting) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
state.pipeline.addDependency(CCRenderState.instance().colourAttrib);
|
||||||
|
state.pipeline.addDependency(CCRenderState.instance().lightCoordAttrib);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void operate() {
|
||||||
|
CCRenderState.instance()
|
||||||
|
.setBrightness(FULL_BRIGHT_BLOCK_BRIGHTNESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int operationID() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
id = CCRenderState.registerOperation();
|
||||||
|
}
|
||||||
|
|
||||||
|
// magic number from 'RenderBlocksCTMFullbright'
|
||||||
|
// this is the brightness of the neonite, anti, glotek blocks
|
||||||
|
// so we use it for custom microblock lighting
|
||||||
|
private final static int FULL_BRIGHT_BLOCK_BRIGHTNESS = 0xF000F0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package team.chisel.client.render;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
|
import codechicken.lib.render.CCRenderState;
|
||||||
|
import codechicken.lib.render.ColourMultiplier;
|
||||||
|
import codechicken.lib.vec.Cuboid6;
|
||||||
|
import codechicken.lib.vec.Vector3;
|
||||||
|
import codechicken.microblock.BlockMicroMaterial;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class FullBrightMicroMaterial extends BlockMicroMaterial {
|
||||||
|
|
||||||
|
public FullBrightMicroMaterial(final Block block, final int meta) {
|
||||||
|
super(block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void renderMicroFace(final Vector3 pos, final int pass, final Cuboid6 bounds) {
|
||||||
|
CCRenderState.instance().pipeline.builder()
|
||||||
|
.add((CCRenderState.IVertexOperation) pos.translation())
|
||||||
|
.add((CCRenderState.IVertexOperation) this.icont())
|
||||||
|
.add((CCRenderState.IVertexOperation) ColourMultiplier.instance(FULL_BRIGHT_COLOR_MULTIPLIER))
|
||||||
|
.add((CCRenderState.IVertexOperation) FullBrightLighting.instance)
|
||||||
|
.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
// magic number from 'RenderBlocksCTMFullbright'
|
||||||
|
// this is what makes the neonite, anti, glotek blocks burn bright as my ass does
|
||||||
|
// so we use it for custom microblock render
|
||||||
|
private final static int FULL_BRIGHT_COLOR_MULTIPLIER = 0xFFFFFFFF;
|
||||||
|
}
|
||||||
@@ -12,27 +12,27 @@ public class RenderBlocksEldritch extends RenderBlocks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static double displacementMap[] = { +0.1165, -0.0352, -0.1208, +0.0906, -0.0295, +0.0302, -0.0973, +0.0548, -0.1077,
|
static double displacementMap[] = { +0.1165, -0.0352, -0.1208, +0.0906, -0.0295, +0.0302, -0.0973, +0.0548, -0.1077,
|
||||||
+0.0662, -0.0932, -0.0925, -0.1161, +0.0073, -0.1084, +0.1136, +0.0307, +0.0316, -0.1066, -0.0237, +0.0614,
|
+0.0662, -0.0932, -0.0925, -0.1161, +0.0073, -0.1084, +0.1136, +0.0307, +0.0316, -0.1066, -0.0237, +0.0614,
|
||||||
-0.0864, +0.0837, +0.1218, +0.0502, -0.0529, -0.0942, +0.1209, -0.0418, +0.1035, +0.0066, -0.0255, +0.0830,
|
-0.0864, +0.0837, +0.1218, +0.0502, -0.0529, -0.0942, +0.1209, -0.0418, +0.1035, +0.0066, -0.0255, +0.0830,
|
||||||
-0.0361, +0.0965, +0.0646, +0.1124, +0.0890, -0.0037, +0.0467, +0.1025, +0.1161, +0.0014, +0.0365, +0.0755,
|
-0.0361, +0.0965, +0.0646, +0.1124, +0.0890, -0.0037, +0.0467, +0.1025, +0.1161, +0.0014, +0.0365, +0.0755,
|
||||||
-0.0025, +0.0739, +0.0656, +0.0571, -0.0813, -0.0062, -0.0904, -0.0005, +0.0612, -0.0227, +0.0138, -0.0899,
|
-0.0025, +0.0739, +0.0656, +0.0571, -0.0813, -0.0062, -0.0904, -0.0005, +0.0612, -0.0227, +0.0138, -0.0899,
|
||||||
-0.0019, -0.1047, +0.1191, -0.1197, -0.1123, +0.0999, +0.0638, +0.0865, +0.0029, -0.0084, +0.1132, -0.0433,
|
-0.0019, -0.1047, +0.1191, -0.1197, -0.1123, +0.0999, +0.0638, +0.0865, +0.0029, -0.0084, +0.1132, -0.0433,
|
||||||
+0.0115, +0.0850, +0.0439, +0.0748, +0.0460, -0.0441, +0.0839, +0.0162, -0.0229, +0.0774, -0.0647, -0.0636,
|
+0.0115, +0.0850, +0.0439, +0.0748, +0.0460, -0.0441, +0.0839, +0.0162, -0.0229, +0.0774, -0.0647, -0.0636,
|
||||||
-0.0709, -0.0719, -0.0194, +0.1070, -0.0466, -0.1200, -0.0996, -0.0298, -0.1035, -0.0006, +0.0530, -0.0939,
|
-0.0709, -0.0719, -0.0194, +0.1070, -0.0466, -0.1200, -0.0996, -0.0298, -0.1035, -0.0006, +0.0530, -0.0939,
|
||||||
-0.1210, +0.0176, +0.0924, +0.0343, -0.0777, +0.1050, -0.0729, -0.0062, -0.1107, -0.0434, -0.0042, +0.0232,
|
-0.1210, +0.0176, +0.0924, +0.0343, -0.0777, +0.1050, -0.0729, -0.0062, -0.1107, -0.0434, -0.0042, +0.0232,
|
||||||
+0.0269, +0.0709, -0.0388, +0.0342, +0.0240, -0.0192, +0.0491, +0.0017, -0.1240, +0.0687, -0.1160, +0.1123,
|
+0.0269, +0.0709, -0.0388, +0.0342, +0.0240, -0.0192, +0.0491, +0.0017, -0.1240, +0.0687, -0.1160, +0.1123,
|
||||||
-0.0332, -0.0260, +0.0476, -0.0049, -0.0893, -0.0243, -0.0371, -0.0230, +0.0656, +0.1080, +0.0781, -0.0648,
|
-0.0332, -0.0260, +0.0476, -0.0049, -0.0893, -0.0243, -0.0371, -0.0230, +0.0656, +0.1080, +0.0781, -0.0648,
|
||||||
+0.0082, -0.1086, -0.0451, -0.0594, -0.1155, -0.0623, -0.0152, +0.0131, -0.0754, +0.0607, +0.0876, -0.0657,
|
+0.0082, -0.1086, -0.0451, -0.0594, -0.1155, -0.0623, -0.0152, +0.0131, -0.0754, +0.0607, +0.0876, -0.0657,
|
||||||
+0.0366, -0.0981, +0.1164, -0.0623, +0.0181, -0.0475, +0.0722, -0.0293, +0.0486, -0.0195, +0.1041, +0.1011,
|
+0.0366, -0.0981, +0.1164, -0.0623, +0.0181, -0.0475, +0.0722, -0.0293, +0.0486, -0.0195, +0.1041, +0.1011,
|
||||||
+0.0042, -0.0045, -0.1031, +0.0110, +0.0058, +0.0083, -0.0782, -0.1003, -0.0082, -0.0304, -0.0971, -0.0097,
|
+0.0042, -0.0045, -0.1031, +0.0110, +0.0058, +0.0083, -0.0782, -0.1003, -0.0082, -0.0304, -0.0971, -0.0097,
|
||||||
-0.0208, -0.1059, -0.0239, -0.0385, +0.0505, +0.0537, -0.1098, -0.0022, -0.0165, -0.0027, -0.0208, +0.0305,
|
-0.0208, -0.1059, -0.0239, -0.0385, +0.0505, +0.0537, -0.1098, -0.0022, -0.0165, -0.0027, -0.0208, +0.0305,
|
||||||
+0.0592, +0.0301, +0.0055, +0.1138, -0.0338, -0.0901, +0.1015, +0.0061, +0.0861, -0.1057, -0.0889, -0.0972,
|
+0.0592, +0.0301, +0.0055, +0.1138, -0.0338, -0.0901, +0.1015, +0.0061, +0.0861, -0.1057, -0.0889, -0.0972,
|
||||||
+0.0783, -0.1052, -0.0932, -0.1103, +0.0497, +0.1222, -0.0146, +0.0632, -0.0240, -0.0193, +0.0676, -0.1128,
|
+0.0783, -0.1052, -0.0932, -0.1103, +0.0497, +0.1222, -0.0146, +0.0632, -0.0240, -0.0193, +0.0676, -0.1128,
|
||||||
-0.0886, +0.0926, +0.0538, -0.0175, -0.0966, -0.0369, +0.1124, -0.0820, -0.1013, -0.0836, -0.0981, -0.0502,
|
-0.0886, +0.0926, +0.0538, -0.0175, -0.0966, -0.0369, +0.1124, -0.0820, -0.1013, -0.0836, -0.0981, -0.0502,
|
||||||
+0.0573, +0.0616, -0.0458, +0.0294, +0.0108, -0.0782, +0.0692, +0.0234, -0.0178, -0.0171, -0.0505, -0.0313,
|
+0.0573, +0.0616, -0.0458, +0.0294, +0.0108, -0.0782, +0.0692, +0.0234, -0.0178, -0.0171, -0.0505, -0.0313,
|
||||||
+0.0538, +0.0462, -0.0758, +0.0556, -0.0023, -0.1086, -0.0100, -0.0897, -0.0409, -0.1161, +0.0212, +0.1229,
|
+0.0538, +0.0462, -0.0758, +0.0556, -0.0023, -0.1086, -0.0100, -0.0897, -0.0409, -0.1161, +0.0212, +0.1229,
|
||||||
-0.0945, +0.0341, +0.1238, +0.0893, -0.1189, -0.1098, -0.0125, +0.1137, -0.0202, +0.0239, -0.0408, +0.0920,
|
-0.0945, +0.0341, +0.1238, +0.0893, -0.1189, -0.1098, -0.0125, +0.1137, -0.0202, +0.0239, -0.0408, +0.0920,
|
||||||
+0.0777, -0.0085, -0.0572, -0.0293, -0.0131, +0.0272, +0.0991, };
|
+0.0777, -0.0085, -0.0572, -0.0293, -0.0131, +0.0272, +0.0991, };
|
||||||
|
|
||||||
static int dmap1 = displacementMap.length * 1 / 6;
|
static int dmap1 = displacementMap.length * 1 / 6;
|
||||||
static int dmap2 = displacementMap.length * 2 / 6;
|
static int dmap2 = displacementMap.length * 2 / 6;
|
||||||
|
|||||||
@@ -54,9 +54,11 @@ public class RenderChiselSnowman extends RenderLiving {
|
|||||||
|
|
||||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED);
|
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED);
|
||||||
boolean is3D = (customRenderer != null
|
boolean is3D = (customRenderer != null
|
||||||
&& customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D));
|
&& customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D));
|
||||||
|
|
||||||
if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())) {
|
if (is3D || RenderBlocks.renderItemIn3d(
|
||||||
|
Block.getBlockFromItem(itemStack.getItem())
|
||||||
|
.getRenderType())) {
|
||||||
float f1 = 0.625F;
|
float f1 = 0.625F;
|
||||||
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
||||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package team.chisel.client.render;
|
package team.chisel.client.render;
|
||||||
|
|
||||||
import team.chisel.ctmlib.CTMRenderer;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||||
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.ctmlib.CTMRenderer;
|
||||||
|
|
||||||
public class RendererCTM extends CTMRenderer {
|
public class RendererCTM extends CTMRenderer {
|
||||||
|
|
||||||
|
|||||||
@@ -10,17 +10,16 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.ctmlib.Drawing;
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.ctmlib.Drawing;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public static int id;
|
public static final int id = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
|
||||||
public RendererCTMPane() {
|
|
||||||
id = RenderingRegistry.getNextAvailableRenderId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||||
@@ -30,9 +29,7 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
Drawing.drawBlock(block, meta, renderer);
|
Drawing.drawBlock(block, meta, renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
class PaneRenderer {
|
static class PaneRenderer {
|
||||||
|
|
||||||
Tessellator tessellator;
|
|
||||||
|
|
||||||
double i0u0;
|
double i0u0;
|
||||||
double i0uh;
|
double i0uh;
|
||||||
@@ -69,8 +66,6 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
double y1;
|
double y1;
|
||||||
|
|
||||||
void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) {
|
void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) {
|
||||||
tessellator = Tessellator.instance;
|
|
||||||
|
|
||||||
i0u0 = icon.getMinU();
|
i0u0 = icon.getMinU();
|
||||||
i0uh = icon.getInterpolatedU(8.0D);
|
i0uh = icon.getInterpolatedU(8.0D);
|
||||||
i0u1 = icon.getMaxU();
|
i0u1 = icon.getMaxU();
|
||||||
@@ -107,6 +102,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderNorthPane() {
|
public void renderNorthPane() {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(xh, y1, z0, i0uh, i0v0);
|
tessellator.addVertexWithUV(xh, y1, z0, i0uh, i0v0);
|
||||||
tessellator.addVertexWithUV(xh, y0, z0, i0uh, i0v1);
|
tessellator.addVertexWithUV(xh, y0, z0, i0uh, i0v1);
|
||||||
tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1);
|
tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1);
|
||||||
@@ -118,6 +115,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderSouthPane() {
|
public void renderSouthPane() {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0);
|
tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0);
|
||||||
tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1);
|
tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1);
|
||||||
tessellator.addVertexWithUV(xh, y0, z1, i0uh, i0v1);
|
tessellator.addVertexWithUV(xh, y0, z1, i0uh, i0v1);
|
||||||
@@ -129,6 +128,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderWestPane() {
|
public void renderWestPane() {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(x0, y1, zh, i0uh, i0v0);
|
tessellator.addVertexWithUV(x0, y1, zh, i0uh, i0v0);
|
||||||
tessellator.addVertexWithUV(x0, y0, zh, i0uh, i0v1);
|
tessellator.addVertexWithUV(x0, y0, zh, i0uh, i0v1);
|
||||||
tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1);
|
tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1);
|
||||||
@@ -140,6 +141,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderEastPane() {
|
public void renderEastPane() {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0);
|
tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0);
|
||||||
tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1);
|
tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1);
|
||||||
tessellator.addVertexWithUV(x1, y0, zh, i0uh, i0v1);
|
tessellator.addVertexWithUV(x1, y0, zh, i0uh, i0v1);
|
||||||
@@ -151,6 +154,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderVerticalNS(double y, double zoff0, double zoff1, double v0, double v1) {
|
public void renderVerticalNS(double y, double zoff0, double zoff1, double v0, double v1) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff0, i1u0, i1v0 + i1v * v0);
|
tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff0, i1u0, i1v0 + i1v * v0);
|
||||||
tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff1, i1u0, i1v0 + i1v * v1);
|
tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff1, i1u0, i1v0 + i1v * v1);
|
||||||
tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff1, i1u1, i1v0 + i1v * v1);
|
tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff1, i1u1, i1v0 + i1v * v1);
|
||||||
@@ -162,6 +167,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderVerticalWE(double y, double xoff0, double xoff1, double v0, double v1) {
|
public void renderVerticalWE(double y, double xoff0, double xoff1, double v0, double v1) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp1, i1u1, i1v0 + i1v * v0);
|
tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp1, i1u1, i1v0 + i1v * v0);
|
||||||
tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp1, i1u1, i1v0 + i1v * v1);
|
tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp1, i1u1, i1v0 + i1v * v1);
|
||||||
tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp0, i1u0, i1v0 + i1v * v1);
|
tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp0, i1u0, i1v0 + i1v * v1);
|
||||||
@@ -173,6 +180,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderHorizontalNS(double zoff, double v0, double v1) {
|
public void renderHorizontalNS(double zoff, double v0, double v1) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(xp0, y1, z0 + zoff, i2u0, i2v0 + i2v * v1);
|
tessellator.addVertexWithUV(xp0, y1, z0 + zoff, i2u0, i2v0 + i2v * v1);
|
||||||
tessellator.addVertexWithUV(xp0, y0, z0 + zoff, i2u0, i2v0 + i2v * v0);
|
tessellator.addVertexWithUV(xp0, y0, z0 + zoff, i2u0, i2v0 + i2v * v0);
|
||||||
tessellator.addVertexWithUV(xp1, y0, z0 + zoff, i2u1, i2v0 + i2v * v0);
|
tessellator.addVertexWithUV(xp1, y0, z0 + zoff, i2u1, i2v0 + i2v * v0);
|
||||||
@@ -185,6 +194,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderHorizontalWE(double xoff, double v0, double v1) {
|
public void renderHorizontalWE(double xoff, double v0, double v1) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(x0 + xoff, y1, zp0, i2u0, i2v0 + i2v * v1);
|
tessellator.addVertexWithUV(x0 + xoff, y1, zp0, i2u0, i2v0 + i2v * v1);
|
||||||
tessellator.addVertexWithUV(x0 + xoff, y0, zp0, i2u0, i2v0 + i2v * v0);
|
tessellator.addVertexWithUV(x0 + xoff, y0, zp0, i2u0, i2v0 + i2v * v0);
|
||||||
tessellator.addVertexWithUV(x0 + xoff, y0, zp1, i2u1, i2v0 + i2v * v0);
|
tessellator.addVertexWithUV(x0 + xoff, y0, zp1, i2u1, i2v0 + i2v * v0);
|
||||||
@@ -196,13 +207,14 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PaneRenderer paneRenderer = new PaneRenderer();
|
final ThreadLocal<PaneRenderer> paneRendererThreadLocal = ThreadLocal.withInitial(PaneRenderer::new);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
BlockPane block = (BlockPane) b;
|
BlockPane block = (BlockPane) b;
|
||||||
Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
final PaneRenderer paneRenderer = paneRendererThreadLocal.get();
|
||||||
|
|
||||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||||
|
|
||||||
@@ -230,12 +242,12 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
if (renderer.hasOverrideBlockTexture()) {
|
if (renderer.hasOverrideBlockTexture()) {
|
||||||
paneRenderer.set(
|
paneRenderer.set(
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
z,
|
z,
|
||||||
renderer.overrideBlockTexture,
|
renderer.overrideBlockTexture,
|
||||||
renderer.overrideBlockTexture,
|
renderer.overrideBlockTexture,
|
||||||
renderer.overrideBlockTexture);
|
renderer.overrideBlockTexture);
|
||||||
} else {
|
} else {
|
||||||
paneRenderer.set(x, y, z, iconPane, iconTop, iconSide);
|
paneRenderer.set(x, y, z, iconPane, iconTop, iconSide);
|
||||||
}
|
}
|
||||||
@@ -259,8 +271,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
boolean isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast;
|
boolean isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast;
|
||||||
boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth
|
boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth
|
||||||
&& !connectsBottomWest
|
&& !connectsBottomWest
|
||||||
&& !connectsBottomEast;
|
&& !connectsBottomEast;
|
||||||
|
|
||||||
if (!connectsNorth && !connectsSouth && !connectsWest && !connectsEast) {
|
if (!connectsNorth && !connectsSouth && !connectsWest && !connectsEast) {
|
||||||
connectsNorth = connectsSouth = connectsWest = connectsEast = true;
|
connectsNorth = connectsSouth = connectsWest = connectsEast = true;
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
import team.chisel.ctmlib.Drawing;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.ctmlib.Drawing;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererEldritch() {
|
public RendererEldritch() {
|
||||||
@@ -24,11 +27,14 @@ public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
|||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderBlocksEldritch renderer = new RenderBlocksEldritch();
|
private static final ThreadLocal<RenderBlocksEldritch> rendererThreadLocal = ThreadLocal
|
||||||
|
.withInitial(RenderBlocksEldritch::new);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks rendererOld) {
|
RenderBlocks rendererOld) {
|
||||||
|
|
||||||
|
final RenderBlocksEldritch renderer = rendererThreadLocal.get();
|
||||||
|
|
||||||
// tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x,
|
// tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x,
|
||||||
// y, z));
|
// y, z));
|
||||||
@@ -54,7 +60,11 @@ public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
|||||||
renderer.renderMaxX = 1.0;
|
renderer.renderMaxX = 1.0;
|
||||||
renderer.renderMaxY = 1.0;
|
renderer.renderMaxY = 1.0;
|
||||||
renderer.renderMaxZ = 1.0;
|
renderer.renderMaxZ = 1.0;
|
||||||
renderer.renderStandardBlock(block, x, y, z);
|
try {
|
||||||
|
renderer.renderStandardBlock(block, x, y, z);
|
||||||
|
} finally {
|
||||||
|
renderer.blockAccess = null;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -7,14 +7,17 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.block.BlockCarvableGlow;
|
import team.chisel.block.BlockCarvableGlow;
|
||||||
import team.chisel.config.Configurations;
|
import team.chisel.config.Configurations;
|
||||||
import team.chisel.ctmlib.Drawing;
|
import team.chisel.ctmlib.Drawing;
|
||||||
import team.chisel.utils.GeneralClient;
|
import team.chisel.utils.GeneralClient;
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererLayeredGlow() {
|
public RendererLayeredGlow() {
|
||||||
@@ -35,14 +38,30 @@ public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
Tessellator.instance.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]);
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
Tessellator.instance.setBrightness(0xF000F0);
|
final boolean prevEnableAO = renderer.enableAO;
|
||||||
|
final int tint = Configurations.configColors[world.getBlockMetadata(x, y, z)];
|
||||||
|
tessellator.setColorOpaque_I(tint);
|
||||||
|
tessellator.setBrightness(0xF000F0);
|
||||||
|
setFullbrightColor(renderer, tint);
|
||||||
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
|
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
|
||||||
|
renderer.enableAO = prevEnableAO;
|
||||||
renderer.renderStandardBlock(block, x, y, z);
|
renderer.renderStandardBlock(block, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void setFullbrightColor(RenderBlocks renderer, int color) {
|
||||||
|
final float r = (color >> 16 & 255) / 255.0F;
|
||||||
|
final float g = (color >> 8 & 255) / 255.0F;
|
||||||
|
final float b = (color & 255) / 255.0F;
|
||||||
|
renderer.enableAO = true;
|
||||||
|
renderer.colorRedTopLeft = renderer.colorRedBottomLeft = renderer.colorRedBottomRight = renderer.colorRedTopRight = r;
|
||||||
|
renderer.colorGreenTopLeft = renderer.colorGreenBottomLeft = renderer.colorGreenBottomRight = renderer.colorGreenTopRight = g;
|
||||||
|
renderer.colorBlueTopLeft = renderer.colorBlueBottomLeft = renderer.colorBlueBottomRight = renderer.colorBlueTopRight = b;
|
||||||
|
renderer.brightnessTopLeft = renderer.brightnessBottomLeft = renderer.brightnessTopRight = renderer.brightnessBottomRight = 0xF000F0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender3DInInventory(int modelId) {
|
public boolean shouldRender3DInInventory(int modelId) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,32 +1,38 @@
|
|||||||
package team.chisel.client.render;
|
package team.chisel.client.render;
|
||||||
|
|
||||||
import static org.lwjgl.opengl.GL11.*;
|
import static org.lwjgl.opengl.GL11.GL_BLEND;
|
||||||
|
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||||
|
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||||
|
import static org.lwjgl.opengl.GL11.glBlendFunc;
|
||||||
|
import static org.lwjgl.opengl.GL11.glDisable;
|
||||||
|
import static org.lwjgl.opengl.GL11.glEnable;
|
||||||
|
import static org.lwjgl.opengl.GL11.glPopMatrix;
|
||||||
|
import static org.lwjgl.opengl.GL11.glPushMatrix;
|
||||||
|
import static org.lwjgl.opengl.GL11.glTranslatef;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.ForgeHooksClient;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
|
|
||||||
import team.chisel.block.BlockMultiLayerBase;
|
|
||||||
import team.chisel.ctmlib.Drawing;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.block.BlockMultiLayerBase;
|
||||||
|
import team.chisel.ctmlib.Drawing;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
float bot = -0.001f, top = 1.0f - bot;
|
final static float bot = -0.001f;
|
||||||
public static int id;
|
final static float top = 1.0f - bot;
|
||||||
|
public static final int id = RenderingRegistry.getNextAvailableRenderId();
|
||||||
public RendererMultiLayer() {
|
|
||||||
id = RenderingRegistry.getNextAvailableRenderId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
|
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
|
||||||
if (blck == null || !(blck instanceof BlockMultiLayerBase)) return;
|
if (!(blck instanceof BlockMultiLayerBase block)) return;
|
||||||
|
|
||||||
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
|
|
||||||
|
|
||||||
if (block.icon != null) {
|
if (block.icon != null) {
|
||||||
renderer.overrideBlockTexture = block.icon;
|
renderer.overrideBlockTexture = block.icon;
|
||||||
@@ -48,11 +54,10 @@ public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
if (blck == null || !(blck instanceof BlockMultiLayerBase)) return false;
|
if (!(blck instanceof BlockMultiLayerBase block)) return false;
|
||||||
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
|
|
||||||
|
|
||||||
if (MinecraftForgeClient.getRenderPass() == 0) {
|
if (ForgeHooksClient.getWorldRenderPass() == 0) {
|
||||||
if (block.icon != null) {
|
if (block.icon != null) {
|
||||||
renderer.overrideBlockTexture = block.icon;
|
renderer.overrideBlockTexture = block.icon;
|
||||||
renderer.renderStandardBlock(block, x, y, z);
|
renderer.renderStandardBlock(block, x, y, z);
|
||||||
|
|||||||
@@ -7,12 +7,15 @@ import net.minecraft.client.renderer.Tessellator;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.block.BlockRoadLine;
|
import team.chisel.block.BlockRoadLine;
|
||||||
import team.chisel.ctmlib.Drawing;
|
import team.chisel.ctmlib.Drawing;
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererRoadLine() {
|
public RendererRoadLine() {
|
||||||
@@ -36,7 +39,7 @@ public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
BlockRoadLine block = (BlockRoadLine) b;
|
BlockRoadLine block = (BlockRoadLine) b;
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
@@ -59,10 +62,14 @@ public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
|||||||
}
|
}
|
||||||
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
|
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
|
||||||
|
|
||||||
boolean N = world.getBlock(x, y, z - 1).equals(block) && world.getBlockMetadata(x, y, z - 1) == meta;
|
boolean N = world.getBlock(x, y, z - 1)
|
||||||
boolean S = world.getBlock(x, y, z + 1).equals(block) && world.getBlockMetadata(x, y, z + 1) == meta;
|
.equals(block) && world.getBlockMetadata(x, y, z - 1) == meta;
|
||||||
boolean W = world.getBlock(x - 1, y, z).equals(block) && world.getBlockMetadata(x - 1, y, z) == meta;
|
boolean S = world.getBlock(x, y, z + 1)
|
||||||
boolean E = world.getBlock(x + 1, y, z).equals(block) && world.getBlockMetadata(x + 1, y, z) == meta;
|
.equals(block) && world.getBlockMetadata(x, y, z + 1) == meta;
|
||||||
|
boolean W = world.getBlock(x - 1, y, z)
|
||||||
|
.equals(block) && world.getBlockMetadata(x - 1, y, z) == meta;
|
||||||
|
boolean E = world.getBlock(x + 1, y, z)
|
||||||
|
.equals(block) && world.getBlockMetadata(x + 1, y, z) == meta;
|
||||||
|
|
||||||
if (!N && !S && !W && !E) {
|
if (!N && !S && !W && !E) {
|
||||||
renderer.renderStandardBlock(block, x, y, z);
|
renderer.renderStandardBlock(block, x, y, z);
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.block.BlockCarvableLayered;
|
import team.chisel.block.BlockCarvableLayered;
|
||||||
import team.chisel.ctmlib.Drawing;
|
import team.chisel.ctmlib.Drawing;
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererSimpleLayered() {
|
public RendererSimpleLayered() {
|
||||||
@@ -30,7 +33,7 @@ public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
renderer.setOverrideBlockTexture(((BlockCarvableLayered) block).getBaseTex());
|
renderer.setOverrideBlockTexture(((BlockCarvableLayered) block).getBaseTex());
|
||||||
renderer.renderStandardBlock(block, x, y, z);
|
renderer.renderStandardBlock(block, x, y, z);
|
||||||
renderer.clearOverrideBlockTexture();
|
renderer.clearOverrideBlockTexture();
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.block.BlockSnakestone;
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
import team.chisel.ctmlib.Drawing;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.block.BlockSnakestone;
|
||||||
|
import team.chisel.ctmlib.Drawing;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererSnakeStone implements ISimpleBlockRenderingHandler {
|
public class RendererSnakeStone implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public static int id;
|
public static int id;
|
||||||
@@ -30,7 +33,7 @@ public class RendererSnakeStone implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
setRenderRotate(renderer, (BlockSnakestone) block, meta);
|
setRenderRotate(renderer, (BlockSnakestone) block, meta);
|
||||||
|
|||||||
@@ -6,18 +6,17 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.block.BlockCarvableStairs;
|
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||||
import team.chisel.ctmlib.Drawing;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.block.BlockCarvableStairs;
|
||||||
|
import team.chisel.ctmlib.Drawing;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererStairs implements ISimpleBlockRenderingHandler {
|
public class RendererStairs implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public static int id;
|
public static final int id = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
|
||||||
public RendererStairs() {
|
|
||||||
id = RenderingRegistry.getNextAvailableRenderId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||||
@@ -30,9 +29,8 @@ public class RendererStairs implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
if (blck == null || !(blck instanceof BlockCarvableStairs)) return false;
|
if (!(blck instanceof BlockCarvableStairs block)) return false;
|
||||||
BlockCarvableStairs block = (BlockCarvableStairs) blck;
|
|
||||||
|
|
||||||
renderer.renderBlockStairs(block, x, y, z);
|
renderer.renderBlockStairs(block, x, y, z);
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,13 @@ import net.minecraftforge.client.IItemRenderer;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.ctmlib.Drawing;
|
import team.chisel.ctmlib.Drawing;
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
import team.chisel.init.ChiselBlocks;
|
import team.chisel.init.ChiselBlocks;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class SubmapManagerAntiblock extends SubmapManagerBase {
|
public class SubmapManagerAntiblock extends SubmapManagerBase {
|
||||||
|
|
||||||
@@ -36,9 +37,9 @@ public class SubmapManagerAntiblock extends SubmapManagerBase {
|
|||||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
Drawing.drawBlock(
|
Drawing.drawBlock(
|
||||||
ChiselBlocks.antiBlock,
|
ChiselBlocks.antiBlock,
|
||||||
ChiselBlocks.antiBlock.getIcon(0, item.getItemDamage()),
|
ChiselBlocks.antiBlock.getIcon(0, item.getItemDamage()),
|
||||||
(RenderBlocks) data[0]);
|
(RenderBlocks) data[0]);
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,10 +75,10 @@ public class SubmapManagerAntiblock extends SubmapManagerBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
private static final ThreadLocal<RenderBlocksCTMFullbright> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
private static RenderBlocksCTMFullbright rb;
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksCTMFullbright::new) : null;
|
||||||
|
|
||||||
private String color;
|
private final String color;
|
||||||
private TextureSubmap submap, submapSmall;
|
private TextureSubmap submap, submapSmall;
|
||||||
|
|
||||||
public SubmapManagerAntiblock(String color) {
|
public SubmapManagerAntiblock(String color) {
|
||||||
@@ -99,9 +100,7 @@ public class SubmapManagerAntiblock extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
if (rb == null) {
|
RenderBlocksCTMFullbright rb = renderBlocksThreadLocal.get();
|
||||||
rb = new RenderBlocksCTMFullbright();
|
|
||||||
}
|
|
||||||
rb.setRenderBoundsFromBlock(block);
|
rb.setRenderBoundsFromBlock(block);
|
||||||
rb.submap = submap;
|
rb.submap = submap;
|
||||||
rb.submapSmall = submapSmall;
|
rb.submapSmall = submapSmall;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import net.minecraft.util.IIcon;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
public abstract class SubmapManagerBase implements ISubmapManager {
|
public abstract class SubmapManagerBase implements ISubmapManager {
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,20 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
|
|
||||||
public class SubmapManagerCarpetFloor extends SubmapManagerBase {
|
public class SubmapManagerCarpetFloor extends SubmapManagerBase {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
private static final ThreadLocal<RenderBlocksCTM> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
private static RenderBlocksCTM rb;
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksCTM::new) : null;
|
||||||
|
|
||||||
private TextureSubmap submap;
|
private TextureSubmap submap;
|
||||||
private TextureSubmap submapSmall;
|
private TextureSubmap submapSmall;
|
||||||
private String color;
|
private final String color;
|
||||||
|
|
||||||
public SubmapManagerCarpetFloor(String color) {
|
public SubmapManagerCarpetFloor(String color) {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
@@ -45,9 +46,7 @@ public class SubmapManagerCarpetFloor extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
if (rb == null) {
|
RenderBlocksCTM rb = renderBlocksThreadLocal.get();
|
||||||
rb = new RenderBlocksCTM();
|
|
||||||
}
|
|
||||||
rb.setRenderBoundsFromBlock(block);
|
rb.setRenderBoundsFromBlock(block);
|
||||||
rb.submap = submap;
|
rb.submap = submap;
|
||||||
rb.submapSmall = submapSmall;
|
rb.submapSmall = submapSmall;
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Triple;
|
import org.apache.commons.lang3.tuple.Triple;
|
||||||
|
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType.AbstractSubmapManager;
|
import com.cricketcraft.chisel.api.rendering.TextureType.AbstractSubmapManager;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
|
|
||||||
public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
||||||
|
|
||||||
@@ -67,21 +67,21 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
|||||||
int iz = MathHelper.floor_double(z);
|
int iz = MathHelper.floor_double(z);
|
||||||
if (type == TextureType.V4 || type == TextureType.V9) {
|
if (type == TextureType.V4 || type == TextureType.V9) {
|
||||||
submap = (TextureSubmap) TextureType
|
submap = (TextureSubmap) TextureType
|
||||||
.getVIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
.getVIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
||||||
submapSmall = (TextureSubmap) TextureType
|
submapSmall = (TextureSubmap) TextureType
|
||||||
.getVIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
.getVIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
||||||
} else {
|
} else {
|
||||||
submap = (TextureSubmap) TextureType
|
submap = (TextureSubmap) TextureType
|
||||||
.getRIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
.getRIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
||||||
submapSmall = (TextureSubmap) TextureType
|
submapSmall = (TextureSubmap) TextureType
|
||||||
.getRIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
.getRIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Submap extends TextureSubmap {
|
private static class Submap extends TextureSubmap {
|
||||||
|
|
||||||
private TextureSubmap[][] submap;
|
private final TextureSubmap[][] submap;
|
||||||
|
|
||||||
public Submap(IIcon base, int wh, TextureSubmap[][] submap) {
|
public Submap(IIcon base, int wh, TextureSubmap[][] submap) {
|
||||||
super(base, wh, wh);
|
super(base, wh, wh);
|
||||||
@@ -99,25 +99,27 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
private final ThreadLocal<RenderBlocksCombinedCTM> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
private RenderBlocksCTM rb;
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksCombinedCTM::new) : null;
|
||||||
|
|
||||||
private TextureSubmap submap, smallSubmap;
|
private TextureSubmap submap, smallSubmap;
|
||||||
private int size;
|
private final int size;
|
||||||
private String texturePath;
|
private final String texturePath;
|
||||||
private int meta;
|
private final int meta;
|
||||||
private IIcon defaultIcon;
|
private IIcon defaultIcon;
|
||||||
private TextureType rType;
|
private final TextureType rType;
|
||||||
|
|
||||||
public SubmapManagerCombinedCTM(int meta, String texturePath, TextureType rType) {
|
public SubmapManagerCombinedCTM(int meta, String texturePath, TextureType rType) {
|
||||||
assert rType == TextureType.R16 || rType == TextureType.R9
|
assert rType == TextureType.R16 || rType == TextureType.R9
|
||||||
|| rType == TextureType.R4
|
|| rType == TextureType.R4
|
||||||
|| rType == TextureType.V4
|
|| rType == TextureType.V4
|
||||||
|| rType == TextureType.V9 : "Not a valid random type!";
|
|| rType == TextureType.V9 : "Not a valid random type!";
|
||||||
|
|
||||||
this.meta = meta;
|
this.meta = meta;
|
||||||
this.texturePath = texturePath;
|
this.texturePath = texturePath;
|
||||||
this.size = Integer.parseInt(rType.name().substring(1, rType.name().length())); // >.>
|
this.size = Integer.parseInt(
|
||||||
|
rType.name()
|
||||||
|
.substring(1)); // >.>
|
||||||
this.rType = rType;
|
this.rType = rType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,9 +131,7 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
if (rb == null) {
|
RenderBlocksCombinedCTM rb = renderBlocksThreadLocal.get();
|
||||||
rb = new RenderBlocksCombinedCTM();
|
|
||||||
}
|
|
||||||
rb.setRenderBoundsFromBlock(block);
|
rb.setRenderBoundsFromBlock(block);
|
||||||
return rb;
|
return rb;
|
||||||
}
|
}
|
||||||
@@ -146,14 +146,15 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
|||||||
TextureSubmap[][] submapsSmall = new TextureSubmap[wh][wh];
|
TextureSubmap[][] submapsSmall = new TextureSubmap[wh][wh];
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
AbstractSubmapManager manager = (AbstractSubmapManager) TextureType.CTMX
|
AbstractSubmapManager manager = (AbstractSubmapManager) TextureType.CTMX
|
||||||
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i);
|
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i);
|
||||||
manager.registerIcons(modName, block, register);
|
manager.registerIcons(modName, block, register);
|
||||||
Object cached = manager.getCachedObject();
|
Object cached = manager.getCachedObject();
|
||||||
Triple<IIcon, TextureSubmap, TextureSubmap> triple = (Triple<IIcon, TextureSubmap, TextureSubmap>) cached;
|
Triple<IIcon, TextureSubmap, TextureSubmap> triple = (Triple<IIcon, TextureSubmap, TextureSubmap>) cached;
|
||||||
submaps[i % wh][i / wh] = triple.getMiddle();
|
submaps[i % wh][i / wh] = triple.getMiddle();
|
||||||
submapsSmall[i % wh][i / wh] = triple.getRight();
|
submapsSmall[i % wh][i / wh] = triple.getRight();
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
defaultIcon = triple.getRight().getBaseIcon();
|
defaultIcon = triple.getRight()
|
||||||
|
.getBaseIcon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
submap = new Submap(base, wh, submaps);
|
submap = new Submap(base, wh, submaps);
|
||||||
|
|||||||
@@ -1,21 +1,27 @@
|
|||||||
package team.chisel.client.render;
|
package team.chisel.client.render;
|
||||||
|
|
||||||
import static team.chisel.ctmlib.Dir.*;
|
import static team.chisel.ctmlib.Dir.BOTTOM;
|
||||||
|
import static team.chisel.ctmlib.Dir.BOTTOM_LEFT;
|
||||||
|
import static team.chisel.ctmlib.Dir.BOTTOM_RIGHT;
|
||||||
|
import static team.chisel.ctmlib.Dir.LEFT;
|
||||||
|
import static team.chisel.ctmlib.Dir.RIGHT;
|
||||||
|
import static team.chisel.ctmlib.Dir.TOP;
|
||||||
|
import static team.chisel.ctmlib.Dir.TOP_LEFT;
|
||||||
|
import static team.chisel.ctmlib.Dir.TOP_RIGHT;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.ctmlib.CTM;
|
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.ctmlib.CTM;
|
||||||
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
public class SubmapManagerFakeController extends SubmapManagerBase {
|
public class SubmapManagerFakeController extends SubmapManagerBase {
|
||||||
|
|
||||||
@@ -63,8 +69,8 @@ public class SubmapManagerFakeController extends SubmapManagerBase {
|
|||||||
map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2);
|
map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2);
|
||||||
} else {
|
} else {
|
||||||
Chisel.logger.info(
|
Chisel.logger.info(
|
||||||
"SubmapManagerFakeController was called on block " + block.getUnlocalizedName()
|
"SubmapManagerFakeController was called on block " + block.getUnlocalizedName()
|
||||||
+ " without declaring texture, using a default texture instead.");
|
+ " without declaring texture, using a default texture instead.");
|
||||||
map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2);
|
map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,21 +7,22 @@ import net.minecraft.util.IIcon;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class SubmapManagerSlab implements ISubmapManager {
|
public class SubmapManagerSlab implements ISubmapManager {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
private static final ThreadLocal<RenderBlocksCTM> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
private static RenderBlocksCTM rb;
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksCTM::new) : null;
|
||||||
|
|
||||||
private TextureSubmap submap;
|
private TextureSubmap submap;
|
||||||
private TextureSubmap submapSmall;
|
private TextureSubmap submapSmall;
|
||||||
private IIcon sideTexture;
|
private IIcon sideTexture;
|
||||||
private String texture;
|
private final String texture;
|
||||||
|
|
||||||
public SubmapManagerSlab(String texture) {
|
public SubmapManagerSlab(String texture) {
|
||||||
this.texture = texture;
|
this.texture = texture;
|
||||||
@@ -49,34 +50,18 @@ public class SubmapManagerSlab implements ISubmapManager {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
if (rb == null) {
|
RenderBlocksCTM rb = renderBlocksThreadLocal.get();
|
||||||
rb = new RenderBlocksCTM();
|
|
||||||
}
|
|
||||||
rb.setRenderBoundsFromBlock(block);
|
rb.setRenderBoundsFromBlock(block);
|
||||||
rb.submap = submap;
|
rb.submap = submap;
|
||||||
rb.submapSmall = submapSmall;
|
rb.submapSmall = submapSmall;
|
||||||
return rb;
|
return rb;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hadOverride = false;
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {}
|
||||||
RenderBlocksCTM rbctm = (RenderBlocksCTM) renderer;
|
|
||||||
if (side.ordinal() < 2 && !rbctm.rendererOld.hasOverrideBlockTexture()) {
|
|
||||||
rbctm.rendererOld.setOverrideBlockTexture(sideTexture);
|
|
||||||
hadOverride = false;
|
|
||||||
} else {
|
|
||||||
hadOverride = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
|
||||||
if (!hadOverride) {
|
|
||||||
((RenderBlocksCTM) renderer).rendererOld.clearOverrideBlockTexture();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -6,10 +6,11 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
|
|
||||||
public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||||
|
|
||||||
@@ -48,10 +49,11 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static RenderBlocksCTMFullbright renderBlocksFullbright;
|
private static final ThreadLocal<RenderBlocksCTMFullbright> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksCTMFullbright::new) : null;
|
||||||
|
|
||||||
private String color;
|
private final String color;
|
||||||
private MaterialType materialType;
|
private final MaterialType materialType;
|
||||||
private TextureSubmap submap, submapSmall;
|
private TextureSubmap submap, submapSmall;
|
||||||
|
|
||||||
public SubmapManagerSpecialMaterial(String color, MaterialType materialType) {
|
public SubmapManagerSpecialMaterial(String color, MaterialType materialType) {
|
||||||
@@ -67,7 +69,8 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||||
String materialName = materialType.name().toLowerCase();
|
String materialName = materialType.name()
|
||||||
|
.toLowerCase();
|
||||||
submap = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color + "-ctm"), 4, 4);
|
submap = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color + "-ctm"), 4, 4);
|
||||||
submapSmall = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color), 2, 2);
|
submapSmall = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color), 2, 2);
|
||||||
}
|
}
|
||||||
@@ -75,12 +78,11 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
if (renderBlocksFullbright == null) {
|
RenderBlocksCTMFullbright renderBlocksFullbright = renderBlocksThreadLocal.get();
|
||||||
renderBlocksFullbright = new RenderBlocksCTMFullbright();
|
|
||||||
}
|
|
||||||
renderBlocksFullbright.setRenderBoundsFromBlock(block);
|
renderBlocksFullbright.setRenderBoundsFromBlock(block);
|
||||||
renderBlocksFullbright.submap = submap;
|
renderBlocksFullbright.submap = submap;
|
||||||
renderBlocksFullbright.submapSmall = submapSmall;
|
renderBlocksFullbright.submapSmall = submapSmall;
|
||||||
return renderBlocksFullbright;
|
return renderBlocksFullbright;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,95 +8,95 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
|
||||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
|
||||||
import team.chisel.ctmlib.TextureSubmap;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||||
|
import team.chisel.ctmlib.TextureSubmap;
|
||||||
|
|
||||||
public class SubmapManagerVoidstone extends SubmapManagerBase {
|
public class SubmapManagerVoidstone extends SubmapManagerBase {
|
||||||
|
|
||||||
// TODO there must be a better more generic way to do this...
|
// TODO there must be a better more generic way to do this...
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private class RenderBlocksVoidstone extends RenderBlocksCTM {
|
private static class RenderBlocksVoidstone extends RenderBlocksCTM {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) {
|
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
super.renderFaceXNeg(block, x, y, z, icon);
|
|
||||||
renderMinX += 0.001;
|
|
||||||
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.WEST.ordinal()));
|
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.WEST.ordinal()));
|
||||||
super.renderFaceXNeg(block, x, y, z, null);
|
super.renderFaceXNeg(block, x, y, z, null);
|
||||||
clearOverrideBlockTexture();
|
clearOverrideBlockTexture();
|
||||||
|
|
||||||
|
super.renderFaceXNeg(block, x, y, z, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) {
|
public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
super.renderFaceXPos(block, x, y, z, icon);
|
|
||||||
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.EAST.ordinal()));
|
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.EAST.ordinal()));
|
||||||
renderMaxX -= 0.001;
|
|
||||||
super.renderFaceXPos(block, x, y, z, null);
|
super.renderFaceXPos(block, x, y, z, null);
|
||||||
clearOverrideBlockTexture();
|
clearOverrideBlockTexture();
|
||||||
|
|
||||||
|
super.renderFaceXPos(block, x, y, z, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) {
|
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
super.renderFaceYNeg(block, x, y, z, icon);
|
|
||||||
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.DOWN.ordinal()));
|
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.DOWN.ordinal()));
|
||||||
renderMinY += 0.001;
|
|
||||||
super.renderFaceYNeg(block, x, y, z, null);
|
super.renderFaceYNeg(block, x, y, z, null);
|
||||||
clearOverrideBlockTexture();
|
clearOverrideBlockTexture();
|
||||||
|
|
||||||
|
super.renderFaceYNeg(block, x, y, z, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) {
|
public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
super.renderFaceYPos(block, x, y, z, icon);
|
|
||||||
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.UP.ordinal()));
|
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.UP.ordinal()));
|
||||||
renderMaxY -= 0.001;
|
|
||||||
super.renderFaceYPos(block, x, y, z, null);
|
super.renderFaceYPos(block, x, y, z, null);
|
||||||
clearOverrideBlockTexture();
|
clearOverrideBlockTexture();
|
||||||
|
|
||||||
|
super.renderFaceYPos(block, x, y, z, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) {
|
public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
super.renderFaceZNeg(block, x, y, z, icon);
|
|
||||||
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.NORTH.ordinal()));
|
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.NORTH.ordinal()));
|
||||||
renderMinZ += 0.001;
|
|
||||||
super.renderFaceZNeg(block, x, y, z, null);
|
super.renderFaceZNeg(block, x, y, z, null);
|
||||||
clearOverrideBlockTexture();
|
clearOverrideBlockTexture();
|
||||||
|
|
||||||
|
super.renderFaceZNeg(block, x, y, z, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) {
|
public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
super.renderFaceZPos(block, x, y, z, icon);
|
|
||||||
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.SOUTH.ordinal()));
|
setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.SOUTH.ordinal()));
|
||||||
renderMaxZ -= 0.001;
|
|
||||||
super.renderFaceZPos(block, x, y, z, null);
|
super.renderFaceZPos(block, x, y, z, null);
|
||||||
clearOverrideBlockTexture();
|
clearOverrideBlockTexture();
|
||||||
|
|
||||||
|
super.renderFaceZPos(block, x, y, z, icon);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
private IIcon getBase(double x, double y, double z, int side) {
|
||||||
private RenderBlocksVoidstone rb;
|
return TextureType.getVIcon(
|
||||||
|
|
||||||
private ISubmapManager overlay;
|
|
||||||
private TextureSubmap base;
|
|
||||||
|
|
||||||
private IIcon getBase(double x, double y, double z, int side) {
|
|
||||||
return TextureType.getVIcon(
|
|
||||||
TextureType.V4,
|
TextureType.V4,
|
||||||
base,
|
base,
|
||||||
MathHelper.floor_double(x),
|
MathHelper.floor_double(x),
|
||||||
MathHelper.floor_double(y),
|
MathHelper.floor_double(y),
|
||||||
MathHelper.floor_double(z),
|
MathHelper.floor_double(z),
|
||||||
side);
|
side);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String texture;
|
private static final ThreadLocal<RenderBlocksVoidstone> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
private int meta;
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksVoidstone::new) : null;
|
||||||
|
|
||||||
|
private ISubmapManager overlay;
|
||||||
|
private static TextureSubmap base;
|
||||||
|
|
||||||
|
private final String texture;
|
||||||
|
private final int meta;
|
||||||
|
|
||||||
public SubmapManagerVoidstone(String texture, int meta) {
|
public SubmapManagerVoidstone(String texture, int meta) {
|
||||||
this.texture = texture;
|
this.texture = texture;
|
||||||
@@ -116,7 +116,7 @@ public class SubmapManagerVoidstone extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||||
overlay = TextureType.getTypeFor(null, modName, texture)
|
overlay = TextureType.getTypeFor(null, modName, texture)
|
||||||
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture);
|
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture);
|
||||||
overlay.registerIcons(modName, block, register);
|
overlay.registerIcons(modName, block, register);
|
||||||
base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2);
|
base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2);
|
||||||
}
|
}
|
||||||
@@ -124,15 +124,18 @@ public class SubmapManagerVoidstone extends SubmapManagerBase {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
if (rb == null) {
|
RenderBlocksVoidstone rb = renderBlocksThreadLocal.get();
|
||||||
rb = new RenderBlocksVoidstone();
|
|
||||||
}
|
|
||||||
RenderBlocks ctx = overlay.createRenderContext(rendererOld, block, world);
|
RenderBlocks ctx = overlay.createRenderContext(rendererOld, block, world);
|
||||||
rb.setRenderBoundsFromBlock(block);
|
rb.setRenderBoundsFromBlock(block);
|
||||||
|
|
||||||
if (ctx instanceof RenderBlocksCTM) {
|
if (ctx instanceof RenderBlocksCTM) {
|
||||||
rb.submap = ((RenderBlocksCTM) ctx).submap;
|
rb.submap = ((RenderBlocksCTM) ctx).submap;
|
||||||
rb.submapSmall = ((RenderBlocksCTM) ctx).submapSmall;
|
rb.submapSmall = ((RenderBlocksCTM) ctx).submapSmall;
|
||||||
|
} else {
|
||||||
|
rb.submap = null;
|
||||||
|
rb.submapSmall = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rb;
|
return rb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,27 +30,27 @@ public class ItemChiselRenderer implements IItemRenderer {
|
|||||||
// Fixes potential render bug with blocks that draw this item
|
// Fixes potential render bug with blocks that draw this item
|
||||||
renderItem.zLevel = 10f;
|
renderItem.zLevel = 10f;
|
||||||
renderItem.renderItemIntoGUI(
|
renderItem.renderItemIntoGUI(
|
||||||
Minecraft.getMinecraft().fontRenderer,
|
Minecraft.getMinecraft().fontRenderer,
|
||||||
Minecraft.getMinecraft().renderEngine,
|
Minecraft.getMinecraft().renderEngine,
|
||||||
stack,
|
stack,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
if (stack.stackTagCompound != null) {
|
if (stack.stackTagCompound != null) {
|
||||||
|
|
||||||
ItemStack chiselTarget = ItemStack
|
ItemStack chiselTarget = ItemStack
|
||||||
.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget"));
|
.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget"));
|
||||||
if (chiselTarget != null) {
|
if (chiselTarget != null) {
|
||||||
|
|
||||||
GL11.glScalef(0.65f, 0.65f, 0.65f);
|
GL11.glScalef(0.65f, 0.65f, 0.65f);
|
||||||
GL11.glTranslatef(-8f, -8f, 0.0f);
|
GL11.glTranslatef(-8f, -8f, 0.0f);
|
||||||
|
|
||||||
renderItem.renderItemIntoGUI(
|
renderItem.renderItemIntoGUI(
|
||||||
Minecraft.getMinecraft().fontRenderer,
|
Minecraft.getMinecraft().fontRenderer,
|
||||||
Minecraft.getMinecraft().renderEngine,
|
Minecraft.getMinecraft().renderEngine,
|
||||||
chiselTarget,
|
chiselTarget,
|
||||||
8,
|
8,
|
||||||
8);
|
8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
package team.chisel.client.render.tile;
|
package team.chisel.client.render.tile;
|
||||||
|
|
||||||
import static org.lwjgl.opengl.GL11.*;
|
import static org.lwjgl.opengl.GL11.GL_ALL_ATTRIB_BITS;
|
||||||
|
import static org.lwjgl.opengl.GL11.GL_BLEND;
|
||||||
|
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_CONSTANT_ALPHA;
|
||||||
|
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||||
|
import static org.lwjgl.opengl.GL11.glBlendFunc;
|
||||||
|
import static org.lwjgl.opengl.GL11.glDepthMask;
|
||||||
|
import static org.lwjgl.opengl.GL11.glEnable;
|
||||||
|
import static org.lwjgl.opengl.GL11.glPopAttrib;
|
||||||
|
import static org.lwjgl.opengl.GL11.glPopMatrix;
|
||||||
|
import static org.lwjgl.opengl.GL11.glPushAttrib;
|
||||||
|
import static org.lwjgl.opengl.GL11.glPushMatrix;
|
||||||
|
import static org.lwjgl.opengl.GL11.glRotatef;
|
||||||
|
import static org.lwjgl.opengl.GL11.glScalef;
|
||||||
|
import static org.lwjgl.opengl.GL11.glTranslated;
|
||||||
|
import static org.lwjgl.opengl.GL11.glTranslatef;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -13,6 +27,7 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
|||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
@@ -25,18 +40,18 @@ import net.minecraftforge.client.model.obj.TextureCoordinate;
|
|||||||
import net.minecraftforge.client.model.obj.Vertex;
|
import net.minecraftforge.client.model.obj.Vertex;
|
||||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||||
|
|
||||||
public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler, IItemRenderer {
|
public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler, IItemRenderer {
|
||||||
|
|
||||||
private static final WavefrontObject model = new WavefrontObject(
|
private static final WavefrontObject model = new WavefrontObject(
|
||||||
new ResourceLocation(Chisel.MOD_ID, "models/autoChisel/autoChisel.obj"));
|
new ResourceLocation(Chisel.MOD_ID, "models/autoChisel/autoChisel.obj"));
|
||||||
private static final ResourceLocation texture = new ResourceLocation(
|
private static final ResourceLocation texture = new ResourceLocation(
|
||||||
Chisel.MOD_ID,
|
Chisel.MOD_ID,
|
||||||
"textures/blocks/autoChisel/autoChisel.png");
|
"textures/blocks/autoChisel/autoChisel.png");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||||
@@ -46,7 +61,7 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
|||||||
@Override
|
@Override
|
||||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||||
return helper == ItemRendererHelper.INVENTORY_BLOCK || helper == ItemRendererHelper.ENTITY_BOBBING
|
return helper == ItemRendererHelper.INVENTORY_BLOCK || helper == ItemRendererHelper.ENTITY_BOBBING
|
||||||
|| helper == ItemRendererHelper.ENTITY_ROTATION;
|
|| helper == ItemRendererHelper.ENTITY_ROTATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -85,7 +100,7 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
Tessellator tes = Tessellator.instance;
|
Tessellator tes = Tessellator.instance;
|
||||||
IIcon icon = renderer.hasOverrideBlockTexture() ? renderer.overrideBlockTexture : block.getIcon(0, 0);
|
IIcon icon = renderer.hasOverrideBlockTexture() ? renderer.overrideBlockTexture : block.getIcon(0, 0);
|
||||||
tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||||
@@ -100,18 +115,18 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
|||||||
TextureCoordinate t = f.textureCoordinates[i];
|
TextureCoordinate t = f.textureCoordinates[i];
|
||||||
if (!renderer.hasOverrideBlockTexture()) {
|
if (!renderer.hasOverrideBlockTexture()) {
|
||||||
tes.addVertexWithUV(
|
tes.addVertexWithUV(
|
||||||
vert.x,
|
vert.x,
|
||||||
vert.y,
|
vert.y,
|
||||||
vert.z,
|
vert.z,
|
||||||
icon.getInterpolatedU(t.u * 16),
|
icon.getInterpolatedU(t.u * 16),
|
||||||
icon.getInterpolatedV(t.v * 16));
|
icon.getInterpolatedV(t.v * 16));
|
||||||
} else {
|
} else {
|
||||||
tes.addVertexWithUV(
|
tes.addVertexWithUV(
|
||||||
vert.x,
|
vert.x,
|
||||||
vert.y,
|
vert.y,
|
||||||
vert.z,
|
vert.z,
|
||||||
icon.getInterpolatedU((t.u * 64) % 16),
|
icon.getInterpolatedU((t.u * 64) % 16),
|
||||||
icon.getInterpolatedV((t.v * 64) % 16));
|
icon.getInterpolatedV((t.v * 64) % 16));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,65 +161,83 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final Random rand = new Random();
|
private static final Random rand = new Random();
|
||||||
|
private final EntityItem entityItem = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) {
|
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) {
|
||||||
|
|
||||||
// Render Blocks
|
// Render Blocks
|
||||||
TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile;
|
try {
|
||||||
EntityItem item = autoChisel.getItemForRendering(TileEntityAutoChisel.TARGET);
|
this.entityItem.setWorld(tile.getWorldObj());
|
||||||
|
TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile;
|
||||||
|
EntityItem item = this.getItemForRendering(autoChisel, TileEntityAutoChisel.TARGET);
|
||||||
|
|
||||||
rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord);
|
rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord);
|
||||||
rand.nextBoolean();
|
rand.nextBoolean();
|
||||||
|
|
||||||
float max = 0.35f;
|
float max = 0.35f;
|
||||||
|
|
||||||
if (!Minecraft.getMinecraft().isGamePaused()) {
|
if (!Minecraft.getMinecraft()
|
||||||
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
|
.isGamePaused()) {
|
||||||
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
|
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
|
||||||
autoChisel.zRot += (rand.nextFloat() * max) - (max / 2);
|
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
|
||||||
}
|
autoChisel.zRot += (rand.nextFloat() * max) - (max / 2);
|
||||||
|
}
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||||
glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||||
glRotatef(autoChisel.xRot, 1, 0, 0);
|
glRotatef(autoChisel.xRot, 1, 0, 0);
|
||||||
glRotatef(autoChisel.yRot, 0, 1, 0);
|
glRotatef(autoChisel.yRot, 0, 1, 0);
|
||||||
glRotatef(autoChisel.zRot, 0, 0, 1);
|
glRotatef(autoChisel.zRot, 0, 0, 1);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glDepthMask(false);
|
glDepthMask(false);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
|
||||||
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
}
|
}
|
||||||
|
|
||||||
item = autoChisel.getItemForRendering(TileEntityAutoChisel.BASE);
|
item = this.getItemForRendering(autoChisel, TileEntityAutoChisel.BASE);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslated(x + 0.35, y + 0.934, z + 0.5);
|
glTranslated(x + 0.35, y + 0.934, z + 0.5);
|
||||||
item.getEntityItem().stackSize = autoChisel.getLastBase() == null ? 1 : autoChisel.getLastBase().stackSize;
|
item.getEntityItem().stackSize = autoChisel.getLastBase() == null ? 1
|
||||||
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
: autoChisel.getLastBase().stackSize;
|
||||||
glPopMatrix();
|
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
||||||
}
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
||||||
item = autoChisel.getItemForRendering(TileEntityAutoChisel.CHISEL);
|
item = this.getItemForRendering(autoChisel, TileEntityAutoChisel.CHISEL);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslated(x + 0.7, y + 1.01, z + 0.5);
|
glTranslated(x + 0.7, y + 1.01, z + 0.5);
|
||||||
float rot = autoChisel.chiselRot == 0 ? 0
|
float rot = autoChisel.chiselRot == 0 ? 0
|
||||||
: autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale)
|
: autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale)
|
||||||
: autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale);
|
: autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale);
|
||||||
glRotatef(rot, 0, 0, 1);
|
glRotatef(rot, 0, 0, 1);
|
||||||
glTranslated(-0.12, 0, 0);
|
glTranslated(-0.12, 0, 0);
|
||||||
glScalef(0.9f, 0.9f, 0.9f);
|
glScalef(0.9f, 0.9f, 0.9f);
|
||||||
boolean was = settings.fancyGraphics;
|
boolean was = settings.fancyGraphics;
|
||||||
settings.fancyGraphics = true;
|
settings.fancyGraphics = true;
|
||||||
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
renderItem.doRender(item, 0, 0, 0, 0, 0);
|
||||||
settings.fancyGraphics = was;
|
settings.fancyGraphics = was;
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
this.entityItem.setWorld(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EntityItem getItemForRendering(TileEntityAutoChisel autoChisel, int slot) {
|
||||||
|
final ItemStack stack = autoChisel.getItemForRendering(slot);
|
||||||
|
if (stack != null) {
|
||||||
|
this.entityItem.setEntityItemStack(stack);
|
||||||
|
return this.entityItem;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -18,15 +18,15 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||||
|
|
||||||
public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements ISimpleBlockRenderingHandler {
|
public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png");
|
private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png");
|
||||||
|
|
||||||
private int renderId;
|
private final int renderId;
|
||||||
|
|
||||||
public RenderCarvableBeacon() {
|
public RenderCarvableBeacon() {
|
||||||
this.renderId = RenderingRegistry.getNextAvailableRenderId();
|
this.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||||
@@ -151,7 +151,7 @@ public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements IS
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
float f = 0.1875F;
|
float f = 0.1875F;
|
||||||
boolean breaking = renderer.hasOverrideBlockTexture();
|
boolean breaking = renderer.hasOverrideBlockTexture();
|
||||||
if (!breaking) {
|
if (!breaking) {
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL12;
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.block.tileentity.TileEntityPresent;
|
import team.chisel.block.tileentity.TileEntityPresent;
|
||||||
import team.chisel.init.ChiselBlocks;
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
|
|
||||||
public class RenderPresent extends TileEntitySpecialRenderer implements IItemRenderer {
|
public class RenderPresent extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||||
|
|
||||||
private ModelChest smallChest = new ModelChest();
|
private ModelChest smallChest = new ModelChest();
|
||||||
@@ -77,8 +77,8 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bindTexture(TileEntityPresent present) {
|
private void bindTexture(TileEntityPresent present) {
|
||||||
int idx = present.getWorldObj().getBlockMetadata(present.xCoord, present.yCoord, present.zCoord)
|
int idx = present.getWorldObj()
|
||||||
+ (present.isConnected() ? 0 : 16);
|
.getBlockMetadata(present.xCoord, present.yCoord, present.zCoord) + (present.isConnected() ? 0 : 16);
|
||||||
ResourceLocation rl = textureCache.get(idx);
|
ResourceLocation rl = textureCache.get(idx);
|
||||||
if (rl == null) {
|
if (rl == null) {
|
||||||
String res = ChiselBlocks.present.getModelTexture(idx % 16);
|
String res = ChiselBlocks.present.getModelTexture(idx % 16);
|
||||||
@@ -106,10 +106,11 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
FMLClientHandler.instance()
|
||||||
|
.getClient().renderEngine.bindTexture(
|
||||||
new ResourceLocation(
|
new ResourceLocation(
|
||||||
Chisel.MOD_ID,
|
Chisel.MOD_ID,
|
||||||
ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png"));
|
ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png"));
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ENTITY:
|
case ENTITY:
|
||||||
renderBlock(0.0F, 1.0F, 0.0F);
|
renderBlock(0.0F, 1.0F, 0.0F);
|
||||||
|
|||||||
@@ -8,20 +8,19 @@ import java.util.Map;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import team.chisel.carving.Carving;
|
|
||||||
import team.chisel.client.gui.GuiChisel;
|
|
||||||
import team.chisel.utils.RecipeUtil;
|
|
||||||
import codechicken.nei.api.GuiInfo;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||||
|
|
||||||
|
import codechicken.nei.api.GuiInfo;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import team.chisel.carving.Carving;
|
||||||
|
import team.chisel.client.gui.GuiChisel;
|
||||||
|
import team.chisel.utils.RecipeUtil;
|
||||||
|
|
||||||
public class Compatibility {
|
public class Compatibility {
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package team.chisel.compat;
|
|||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.carving.Carving;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.IMC;
|
import com.cricketcraft.chisel.api.IMC;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.carving.Carving;
|
||||||
|
|
||||||
public class IMCHandler {
|
public class IMCHandler {
|
||||||
|
|
||||||
@@ -48,11 +48,11 @@ public class IMCHandler {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Chisel.logger.error(
|
Chisel.logger.error(
|
||||||
"Could not handle data {} for IMC type {}. This was sent from mod {}.\n"
|
"Could not handle data {} for IMC type {}. This was sent from mod {}.\n"
|
||||||
+ "!! This is a bug in that mod !!\nSwallowing error and continuing...",
|
+ "!! This is a bug in that mod !!\nSwallowing error and continuing...",
|
||||||
value,
|
value,
|
||||||
type.name(),
|
type.name(),
|
||||||
message.getSender());
|
message.getSender());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,6 @@ package team.chisel.compat;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@@ -16,6 +11,11 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import com.cricketcraft.chisel.api.ICarvable;
|
import com.cricketcraft.chisel.api.ICarvable;
|
||||||
|
|
||||||
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||||
|
|
||||||
public class WailaCompat implements IWailaDataProvider {
|
public class WailaCompat implements IWailaDataProvider {
|
||||||
|
|
||||||
private WailaCompat() {}
|
private WailaCompat() {}
|
||||||
@@ -27,31 +27,31 @@ public class WailaCompat implements IWailaDataProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
public List<String> getWailaHead(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
||||||
IWailaConfigHandler configHandler) {
|
IWailaConfigHandler configHandler) {
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
public List<String> getWailaBody(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
||||||
IWailaConfigHandler configHandler) {
|
IWailaConfigHandler configHandler) {
|
||||||
if (accessor.getBlock() instanceof ICarvable) {
|
if (accessor.getBlock() instanceof ICarvable) {
|
||||||
ICarvable block = (ICarvable) accessor.getBlock();
|
ICarvable block = (ICarvable) accessor.getBlock();
|
||||||
MovingObjectPosition pos = accessor.getPosition();
|
MovingObjectPosition pos = accessor.getPosition();
|
||||||
strings.add(
|
strings.add(
|
||||||
block.getManager(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getMetadata())
|
block.getManager(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getMetadata())
|
||||||
.getDescription());
|
.getDescription());
|
||||||
}
|
}
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
public List<String> getWailaTail(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
||||||
IWailaConfigHandler configHandler) {
|
IWailaConfigHandler configHandler) {
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
int y, int z) {
|
int y, int z) {
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
package team.chisel.compat.fmp;
|
package team.chisel.compat.fmp;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
import codechicken.lib.vec.BlockCoord;
|
|
||||||
import codechicken.multipart.MultiPartRegistry;
|
|
||||||
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
|
||||||
import codechicken.multipart.MultiPartRegistry.IPartFactory;
|
|
||||||
import codechicken.multipart.TMultiPart;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
public class FMPCompat implements IPartFactory, IPartConverter {
|
import codechicken.lib.data.MCDataInput;
|
||||||
|
import codechicken.lib.vec.BlockCoord;
|
||||||
|
import codechicken.microblock.MicroMaterialRegistry;
|
||||||
|
import codechicken.multipart.MultiPartRegistry;
|
||||||
|
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
||||||
|
import codechicken.multipart.MultiPartRegistry.IPartFactory2;
|
||||||
|
import codechicken.multipart.TMultiPart;
|
||||||
|
import team.chisel.client.render.FullBrightMicroMaterial;
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
|
public class FMPCompat implements IPartFactory2, IPartConverter {
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
MultiPartRegistry.registerConverter(this);
|
MultiPartRegistry.registerConverter(this);
|
||||||
MultiPartRegistry.registerParts(this, new String[] { "chisel_torch" });
|
MultiPartRegistry.registerPartFactory(this, "chisel_torch");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -36,10 +41,33 @@ public class FMPCompat implements IPartFactory, IPartConverter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TMultiPart createPart(String type, boolean client) {
|
public TMultiPart createPart(String type, NBTTagCompound nbt) {
|
||||||
|
return newPart(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TMultiPart createPart(String type, MCDataInput packet) {
|
||||||
|
return newPart(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TMultiPart createPartForClientPreview(String type, NBTTagCompound nbt) {
|
||||||
|
return newPart(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static TMultiPart newPart(String type) {
|
||||||
if (type.equals("chisel_torch")) {
|
if (type.equals("chisel_torch")) {
|
||||||
return new PartChiselTorch();
|
return new PartChiselTorch();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void registerGlowieVariation(IVariationInfo info, Block block) {
|
||||||
|
int meta = info.getVariation()
|
||||||
|
.getBlockMeta();
|
||||||
|
|
||||||
|
MicroMaterialRegistry.registerMaterial(
|
||||||
|
new FullBrightMicroMaterial(block, meta),
|
||||||
|
block.getUnlocalizedName() + ((meta > 0) ? ("_" + meta) : ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,13 +6,13 @@ import net.minecraft.item.ItemBlock;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import team.chisel.block.BlockCarvableTorch;
|
|
||||||
import codechicken.lib.vec.BlockCoord;
|
import codechicken.lib.vec.BlockCoord;
|
||||||
import codechicken.multipart.TMultiPart;
|
import codechicken.multipart.TMultiPart;
|
||||||
import codechicken.multipart.TileMultipart;
|
import codechicken.multipart.TileMultipart;
|
||||||
import codechicken.multipart.minecraft.TorchPart;
|
import codechicken.multipart.minecraft.TorchPart;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import team.chisel.block.BlockCarvableTorch;
|
||||||
|
|
||||||
public class ItemBlockChiselTorchPart extends ItemBlock {
|
public class ItemBlockChiselTorchPart extends ItemBlock {
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) {
|
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) {
|
||||||
return (placePart(world, new BlockCoord(x, y, z).offset(side), stack, side, false))
|
return (placePart(world, new BlockCoord(x, y, z).offset(side), stack, side, false))
|
||||||
|| (super.func_150936_a(world, x, y, z, side, player, stack));
|
|| (super.func_150936_a(world, x, y, z, side, player, stack));
|
||||||
}
|
}
|
||||||
|
|
||||||
public TMultiPart createMultiPart(World world, BlockCoord pos, ItemStack item, int side) {
|
public TMultiPart createMultiPart(World world, BlockCoord pos, ItemStack item, int side) {
|
||||||
@@ -55,7 +55,7 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
float hitX, float hitY, float hitZ) {
|
float hitX, float hitY, float hitZ) {
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
BlockCoord pos = new BlockCoord(x, y, z);
|
BlockCoord pos = new BlockCoord(x, y, z);
|
||||||
if (!block.isReplaceable(world, x, y, z)) {
|
if (!block.isReplaceable(world, x, y, z)) {
|
||||||
@@ -63,12 +63,12 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
|
|||||||
}
|
}
|
||||||
if (placePart(world, pos, stack, side, !world.isRemote)) {
|
if (placePart(world, pos, stack, side, !world.isRemote)) {
|
||||||
world.playSoundEffect(
|
world.playSoundEffect(
|
||||||
pos.x + 0.5F,
|
pos.x + 0.5F,
|
||||||
pos.y + 0.5F,
|
pos.y + 0.5F,
|
||||||
pos.z + 0.5F,
|
pos.z + 0.5F,
|
||||||
field_150939_a.stepSound.func_150496_b(),
|
field_150939_a.stepSound.func_150496_b(),
|
||||||
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||||
block.stepSound.getPitch() * 0.8F);
|
block.stepSound.getPitch() * 0.8F);
|
||||||
stack.stackSize -= 1;
|
stack.stackSize -= 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package team.chisel.compat.fmp;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
import team.chisel.init.ChiselBlocks;
|
|
||||||
import codechicken.lib.data.MCDataInput;
|
import codechicken.lib.data.MCDataInput;
|
||||||
import codechicken.lib.data.MCDataOutput;
|
import codechicken.lib.data.MCDataOutput;
|
||||||
import codechicken.multipart.minecraft.TorchPart;
|
import codechicken.multipart.minecraft.TorchPart;
|
||||||
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
public class PartChiselTorch extends TorchPart {
|
public class PartChiselTorch extends TorchPart {
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package team.chisel.compat.nei;
|
|||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import team.chisel.Chisel;
|
|
||||||
import team.chisel.client.gui.GuiChisel;
|
|
||||||
import codechicken.nei.api.API;
|
import codechicken.nei.api.API;
|
||||||
import codechicken.nei.api.IConfigureNEI;
|
import codechicken.nei.api.IConfigureNEI;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.client.gui.GuiChisel;
|
||||||
|
|
||||||
public class NEIChiselConfig implements IConfigureNEI {
|
public class NEIChiselConfig implements IConfigureNEI {
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@ public class NEIChiselConfig implements IConfigureNEI {
|
|||||||
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "limestone_slab_top")));
|
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "limestone_slab_top")));
|
||||||
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_slab_top")));
|
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_slab_top")));
|
||||||
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_pillar_slab_top")));
|
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_pillar_slab_top")));
|
||||||
|
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "concrete_slab_top")));
|
||||||
|
|
||||||
RecipeHandlerChisel handler = new RecipeHandlerChisel();
|
RecipeHandlerChisel handler = new RecipeHandlerChisel();
|
||||||
API.registerRecipeHandler(handler);
|
API.registerRecipeHandler(handler);
|
||||||
|
|||||||
@@ -7,20 +7,21 @@ import java.util.List;
|
|||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import team.chisel.carving.Carving;
|
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||||
import team.chisel.client.gui.GuiChisel;
|
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||||
|
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||||
|
|
||||||
import codechicken.lib.gui.GuiDraw;
|
import codechicken.lib.gui.GuiDraw;
|
||||||
import codechicken.nei.NEIServerUtils;
|
import codechicken.nei.NEIServerUtils;
|
||||||
import codechicken.nei.PositionedStack;
|
import codechicken.nei.PositionedStack;
|
||||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
import team.chisel.carving.Carving;
|
||||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
import team.chisel.client.gui.GuiChisel;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
|
||||||
|
|
||||||
public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "Chisel";
|
return StatCollector.translateToLocal("chisel.nei.title");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -109,10 +110,10 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void loadTransferRects() {
|
public void loadTransferRects() {
|
||||||
this.transferRects.add(
|
this.transferRects.add(
|
||||||
new TemplateRecipeHandler.RecipeTransferRect(
|
new TemplateRecipeHandler.RecipeTransferRect(
|
||||||
new Rectangle(75, 22, 15, 13),
|
new Rectangle(75, 22, 15, 13),
|
||||||
"chisel2.chisel",
|
"chisel2.chisel",
|
||||||
new Object[0]));
|
new Object[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -120,7 +121,8 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
|||||||
if (outputId.equals("chisel2.chisel")) {
|
if (outputId.equals("chisel2.chisel")) {
|
||||||
for (String name : Carving.chisel.getSortedGroupNames()) {
|
for (String name : Carving.chisel.getSortedGroupNames()) {
|
||||||
ICarvingGroup g = Carving.chisel.getGroup(name);
|
ICarvingGroup g = Carving.chisel.getGroup(name);
|
||||||
if (!g.getVariations().isEmpty()) {
|
if (!g.getVariations()
|
||||||
|
.isEmpty()) {
|
||||||
addCached(getVariationStacks(g));
|
addCached(getVariationStacks(g));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loaded 100 of 3525 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user