Compare 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 |
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
|
||||||
@@ -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,22 +1,23 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.github.GTNewHorizons:CodeChickenCore:1.1.11:dev")
|
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.12:dev")
|
||||||
implementation("com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev")
|
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.84-GTNH:dev")
|
||||||
implementation("com.github.GTNewHorizons:NotEnoughItems:2.3.82-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.6.0:dev") {
|
|
||||||
transitive = false
|
|
||||||
}
|
|
||||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.3.4: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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
@@ -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.
|
||||||
|
|||||||
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -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.2')
|
|
||||||
//devLocal '.' // Use this when testing config updates locally
|
|
||||||
}
|
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -20,9 +20,12 @@ 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;
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
|
|
||||||
public class CarvableHelper {
|
public class CarvableHelper {
|
||||||
@@ -187,11 +190,15 @@ public class CarvableHelper {
|
|||||||
Block block = info.getVariation()
|
Block block = info.getVariation()
|
||||||
.getBlock();
|
.getBlock();
|
||||||
|
|
||||||
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
if (Loader.isModLoaded("ForgeMultipart") && block instanceof BlockCarvableGlowie) {
|
||||||
FMPIMC.registerFMP(
|
FMPCompat.registerGlowieVariation(info, block);
|
||||||
block,
|
} else {
|
||||||
info.getVariation()
|
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
||||||
.getBlockMeta());
|
FMPIMC.registerFMP(
|
||||||
|
block,
|
||||||
|
info.getVariation()
|
||||||
|
.getBlockMeta());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forbidChiseling) return;
|
if (forbidChiseling) return;
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ 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);
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -18,6 +23,7 @@ import org.apache.commons.lang3.tuple.Triple;
|
|||||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||||
|
|
||||||
|
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.CTM;
|
import team.chisel.ctmlib.CTM;
|
||||||
@@ -84,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);
|
||||||
}
|
}
|
||||||
@@ -100,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;
|
||||||
@@ -137,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();
|
||||||
@@ -205,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;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -269,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;
|
||||||
@@ -289,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) {
|
||||||
@@ -324,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,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;
|
||||||
@@ -423,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;
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ 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) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ import team.chisel.world.GeneratorChisel;
|
|||||||
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";
|
||||||
@@ -67,7 +67,7 @@ public class Chisel {
|
|||||||
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,
|
||||||
@@ -75,6 +75,7 @@ public class Chisel {
|
|||||||
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;
|
||||||
@@ -148,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();
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
|
|||||||
@@ -7,21 +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 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.Chisel;
|
||||||
import team.chisel.entity.EntityChiselSnowman;
|
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;
|
||||||
@@ -32,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
|
||||||
@@ -122,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,6 +6,7 @@ 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;
|
||||||
@@ -19,6 +20,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.Chisel;
|
import team.chisel.Chisel;
|
||||||
|
import team.chisel.config.Configurations;
|
||||||
|
|
||||||
public class BlockCarvableSand extends BlockSand implements ICarvable {
|
public class BlockCarvableSand extends BlockSand implements ICarvable {
|
||||||
|
|
||||||
@@ -83,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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -4,28 +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 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;
|
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");
|
||||||
@@ -33,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);
|
||||||
|
|||||||
@@ -21,31 +21,34 @@ public class BlockConcrete extends BlockCarvable {
|
|||||||
super();
|
super();
|
||||||
FMLCommonHandler.instance()
|
FMLCommonHandler.instance()
|
||||||
.bus()
|
.bus()
|
||||||
.register(this);
|
.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)
|
||||||
&& event.player.onGround
|
public void speedupPlayer(PlayerTickEvent event) {
|
||||||
&& event.player instanceof EntityPlayerSP) {
|
if (event.phase == Phase.START && event.side.isClient()
|
||||||
if (manualInputCheck == null) {
|
&& event.player.onGround
|
||||||
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
&& event.player instanceof EntityPlayerSP) {
|
||||||
}
|
if (manualInputCheck == null) {
|
||||||
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||||
Block below = player.worldObj.getBlock(
|
}
|
||||||
MathHelper.floor_double(player.posX),
|
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||||
MathHelper.floor_double(player.posY) - 2,
|
Block below = player.worldObj.getBlock(
|
||||||
MathHelper.floor_double(player.posZ));
|
MathHelper.floor_double(player.posX),
|
||||||
if (below == this) {
|
MathHelper.floor_double(player.posY) - 2,
|
||||||
manualInputCheck.updatePlayerMoveState();
|
MathHelper.floor_double(player.posZ));
|
||||||
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
if (below == BlockConcrete.this) {
|
||||||
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
manualInputCheck.updatePlayerMoveState();
|
||||||
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||||
|
player.motionX *= 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -37,6 +36,8 @@ 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()
|
return "item.upgrade_" + this.name()
|
||||||
@@ -62,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";
|
||||||
@@ -380,7 +380,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
|||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
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;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -10,17 +10,16 @@ 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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.ctmlib.Drawing;
|
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));
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ 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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.ctmlib.Drawing;
|
import team.chisel.ctmlib.Drawing;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererEldritch() {
|
public RendererEldritch() {
|
||||||
@@ -24,12 +27,15 @@ 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,6 +7,8 @@ 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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
@@ -15,6 +17,7 @@ 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;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererLayeredGlow() {
|
public RendererLayeredGlow() {
|
||||||
@@ -36,13 +39,29 @@ 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 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.block.BlockMultiLayerBase;
|
||||||
import team.chisel.ctmlib.Drawing;
|
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;
|
||||||
@@ -49,10 +55,9 @@ 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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
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;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererRoadLine() {
|
public RendererRoadLine() {
|
||||||
|
|||||||
@@ -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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
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;
|
||||||
|
|
||||||
|
@ThreadSafeISBRH(perThread = false)
|
||||||
public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
public RendererSimpleLayered() {
|
public RendererSimpleLayered() {
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ 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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.block.BlockSnakestone;
|
import team.chisel.block.BlockSnakestone;
|
||||||
import team.chisel.ctmlib.Drawing;
|
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;
|
||||||
|
|||||||
@@ -6,18 +6,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.ISimpleBlockRenderingHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import team.chisel.block.BlockCarvableStairs;
|
import team.chisel.block.BlockCarvableStairs;
|
||||||
import team.chisel.ctmlib.Drawing;
|
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) {
|
||||||
@@ -31,8 +30,7 @@ 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,6 +10,7 @@ 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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.ctmlib.Drawing;
|
import team.chisel.ctmlib.Drawing;
|
||||||
@@ -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,6 +6,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.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.RenderBlocksCTM;
|
||||||
@@ -13,12 +14,12 @@ 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;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ 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.RenderBlocksCTM;
|
||||||
@@ -78,9 +79,9 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
@@ -98,15 +99,15 @@ 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
|
||||||
@@ -118,10 +119,7 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
|||||||
this.texturePath = texturePath;
|
this.texturePath = texturePath;
|
||||||
this.size = Integer.parseInt(
|
this.size = Integer.parseInt(
|
||||||
rType.name()
|
rType.name()
|
||||||
.substring(
|
.substring(1)); // >.>
|
||||||
1,
|
|
||||||
rType.name()
|
|
||||||
.length())); // >.>
|
|
||||||
this.rType = rType;
|
this.rType = rType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
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;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ 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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import team.chisel.ctmlib.ISubmapManager;
|
import team.chisel.ctmlib.ISubmapManager;
|
||||||
@@ -15,13 +16,13 @@ import team.chisel.ctmlib.TextureSubmap;
|
|||||||
|
|
||||||
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,6 +6,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.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.RenderBlocksCTM;
|
||||||
@@ -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) {
|
||||||
@@ -76,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
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.ISubmapManager;
|
||||||
@@ -21,81 +22,81 @@ 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IIcon getBase(double x, double y, double z, int side) {
|
||||||
|
return TextureType.getVIcon(
|
||||||
|
TextureType.V4,
|
||||||
|
base,
|
||||||
|
MathHelper.floor_double(x),
|
||||||
|
MathHelper.floor_double(y),
|
||||||
|
MathHelper.floor_double(z),
|
||||||
|
side);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
private static final ThreadLocal<RenderBlocksVoidstone> renderBlocksThreadLocal = FMLLaunchHandler.side()
|
||||||
private RenderBlocksVoidstone rb;
|
.isClient() ? ThreadLocal.withInitial(RenderBlocksVoidstone::new) : null;
|
||||||
|
|
||||||
private ISubmapManager overlay;
|
private ISubmapManager overlay;
|
||||||
private TextureSubmap base;
|
private static TextureSubmap base;
|
||||||
|
|
||||||
private IIcon getBase(double x, double y, double z, int side) {
|
private final String texture;
|
||||||
return TextureType.getVIcon(
|
private final int meta;
|
||||||
TextureType.V4,
|
|
||||||
base,
|
|
||||||
MathHelper.floor_double(x),
|
|
||||||
MathHelper.floor_double(y),
|
|
||||||
MathHelper.floor_double(z),
|
|
||||||
side);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String texture;
|
|
||||||
private int meta;
|
|
||||||
|
|
||||||
public SubmapManagerVoidstone(String texture, int meta) {
|
public SubmapManagerVoidstone(String texture, int meta) {
|
||||||
this.texture = texture;
|
this.texture = texture;
|
||||||
@@ -123,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
@@ -146,66 +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()
|
if (!Minecraft.getMinecraft()
|
||||||
.isGamePaused()) {
|
.isGamePaused()) {
|
||||||
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
|
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
|
||||||
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
|
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
|
||||||
autoChisel.zRot += (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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements IS
|
|||||||
|
|
||||||
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();
|
||||||
|
|||||||
@@ -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 com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import codechicken.lib.data.MCDataInput;
|
||||||
import codechicken.lib.vec.BlockCoord;
|
import codechicken.lib.vec.BlockCoord;
|
||||||
|
import codechicken.microblock.MicroMaterialRegistry;
|
||||||
import codechicken.multipart.MultiPartRegistry;
|
import codechicken.multipart.MultiPartRegistry;
|
||||||
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
||||||
import codechicken.multipart.MultiPartRegistry.IPartFactory;
|
import codechicken.multipart.MultiPartRegistry.IPartFactory2;
|
||||||
import codechicken.multipart.TMultiPart;
|
import codechicken.multipart.TMultiPart;
|
||||||
|
import team.chisel.client.render.FullBrightMicroMaterial;
|
||||||
import team.chisel.init.ChiselBlocks;
|
import team.chisel.init.ChiselBlocks;
|
||||||
|
|
||||||
public class FMPCompat implements IPartFactory, IPartConverter {
|
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) : ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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,6 +7,7 @@ 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;
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ public class Configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* features */
|
/* features */
|
||||||
for (Features feature : Features.values()) {
|
for (Features feature : Features.VALUES) {
|
||||||
features.put(
|
features.put(
|
||||||
featureName(feature),
|
featureName(feature),
|
||||||
config.get("features", featureName(feature), true)
|
config.get("features", featureName(feature), true)
|
||||||
|
|||||||
@@ -0,0 +1,367 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
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 java.util.EnumMap;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.IConnectable;
|
||||||
|
import com.cricketcraft.chisel.api.IConnectionAccess;
|
||||||
|
import com.cricketcraft.chisel.api.IFacade;
|
||||||
|
import com.google.common.base.Optional;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import gnu.trove.map.TIntObjectMap;
|
||||||
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
|
|
||||||
|
//@formatter:off
|
||||||
|
/**
|
||||||
|
* The CTM renderer will draw the block's FACE using by assembling 4 quadrants from the 5 available block
|
||||||
|
* textures. The normal Texture.png is the blocks "unconnected" texture, and is used when CTM is disabled or the block
|
||||||
|
* has nothing to connect to. This texture has all of the outside corner quadrants The texture-ctm.png contains the
|
||||||
|
* rest of the quadrants.
|
||||||
|
* <pre><blockquote>
|
||||||
|
* ┌─────────────────┐ ┌────────────────────────────────┐
|
||||||
|
* │ texture.png │ │ texture-ctm.png │
|
||||||
|
* │ ╔══════╤══════╗ │ │ ──────┼────── ║ ─────┼───── ║ │
|
||||||
|
* │ ║ │ ║ │ │ │ │ │║ │ ║ │
|
||||||
|
* │ ║ 16 │ 17 ║ │ │ │ 0 │ 1 │║ 2 │ 3 ║ │
|
||||||
|
* │ ╟──────┼──────╢ │ │ ┼──────┼──────┼╟──────┼──────╢ │
|
||||||
|
* │ ║ │ ║ │ │ │ │ │║ │ ║ │
|
||||||
|
* │ ║ 18 │ 19 ║ │ │ │ 4 │ 5 │║ 6 │ 7 ║ │
|
||||||
|
* │ ╚══════╧══════╝ │ │ ──────┼────── ║ ─────┼───── ║ │
|
||||||
|
* └─────────────────┘ │ ═══════╤═══════╝ ─────┼───── ╚ │
|
||||||
|
* │ │ │ ││ │ │ │
|
||||||
|
* │ │ 8 │ 9 ││ 10 │ 11 │ │
|
||||||
|
* │ ┼──────┼──────┼┼──────┼──────┼ │
|
||||||
|
* │ │ │ ││ │ │ │
|
||||||
|
* │ │ 12 │ 13 ││ 14 │ 15 │ │
|
||||||
|
* │ ═══════╧═══════╗ ─────┼───── ╔ │
|
||||||
|
* └────────────────────────────────┘
|
||||||
|
* </blockquote></pre>
|
||||||
|
* combining { 18, 13, 9, 16 }, we can generate a texture connected to the right!
|
||||||
|
* <pre><blockquote>
|
||||||
|
* ╔══════╤═══════
|
||||||
|
* ║ │ │
|
||||||
|
* ║ 16 │ 9 │
|
||||||
|
* ╟──────┼──────┼
|
||||||
|
* ║ │ │
|
||||||
|
* ║ 18 │ 13 │
|
||||||
|
* ╚══════╧═══════
|
||||||
|
* </blockquote></pre>
|
||||||
|
*
|
||||||
|
* combining { 18, 13, 11, 2 }, we can generate a texture, in the shape of an L (connected to the right, and up
|
||||||
|
* <pre><blockquote>
|
||||||
|
* ║ ─────┼───── ╚
|
||||||
|
* ║ │ │
|
||||||
|
* ║ 2 │ 11 │
|
||||||
|
* ╟──────┼──────┼
|
||||||
|
* ║ │ │
|
||||||
|
* ║ 18 │ 13 │
|
||||||
|
* ╚══════╧═══════
|
||||||
|
* </blockquote></pre>
|
||||||
|
*
|
||||||
|
* HAVE FUN!
|
||||||
|
* -CptRageToaster-
|
||||||
|
*/
|
||||||
|
//@formatter:on
|
||||||
|
public class CTM {
|
||||||
|
|
||||||
|
/** Some hardcoded offset values for the different corner indeces */
|
||||||
|
protected static int[] submapOffsets = { 4, 5, 1, 0 };
|
||||||
|
/** For use via the Chisel 2 config only, altering this could cause unintended behavior */
|
||||||
|
public static boolean disableObscuredFaceCheckConfig = false;
|
||||||
|
|
||||||
|
public Optional<Boolean> disableObscuredFaceCheck = Optional.absent();
|
||||||
|
|
||||||
|
protected TIntObjectMap<Dir[]> submapMap = new TIntObjectHashMap<>();
|
||||||
|
protected EnumMap<Dir, Boolean> connectionMap = Maps.newEnumMap(Dir.class);
|
||||||
|
|
||||||
|
protected CTM() {
|
||||||
|
for (Dir dir : Dir.VALUES) {
|
||||||
|
connectionMap.put(dir, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mapping the different corner indeces to their respective dirs
|
||||||
|
submapMap.put(0, new Dir[] { BOTTOM, LEFT, BOTTOM_LEFT });
|
||||||
|
submapMap.put(1, new Dir[] { BOTTOM, RIGHT, BOTTOM_RIGHT });
|
||||||
|
submapMap.put(2, new Dir[] { TOP, RIGHT, TOP_RIGHT });
|
||||||
|
submapMap.put(3, new Dir[] { TOP, LEFT, TOP_LEFT });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CTM getInstance() {
|
||||||
|
return new CTM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The indeces of the typical 4x4 submap to use for the given face at the given location.
|
||||||
|
*
|
||||||
|
* Indeces are in counter-clockwise order starting at bottom left.
|
||||||
|
*/
|
||||||
|
public int[] getSubmapIndices(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
int[] ret = new int[] { 18, 19, 17, 16 };
|
||||||
|
|
||||||
|
if (world == null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
buildConnectionMap(world, x, y, z, side, block, meta);
|
||||||
|
|
||||||
|
// Map connections to submap indeces
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
fillSubmaps(ret, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the connection map and stores it in this CTM instance. The {@link #connected(Dir)},
|
||||||
|
* {@link #connectedAnd(Dir...)}, and {@link #connectedOr(Dir...)} methods can be used to access it.
|
||||||
|
*/
|
||||||
|
public void buildConnectionMap(IBlockAccess world, int x, int y, int z, int side, Block block, int meta) {
|
||||||
|
for (Dir dir : Dir.VALUES) {
|
||||||
|
connectionMap.put(dir, dir.isConnected(this, world, x, y, z, side, block, meta));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillSubmaps(int[] ret, int idx) {
|
||||||
|
Dir[] dirs = submapMap.get(idx);
|
||||||
|
if (connectedOr(dirs[0], dirs[1])) {
|
||||||
|
if (connectedAnd(dirs)) {
|
||||||
|
// If all dirs are connected, we use the fully connected face,
|
||||||
|
// the base offset value.
|
||||||
|
ret[idx] = submapOffsets[idx];
|
||||||
|
} else {
|
||||||
|
// This is a bit magic-y, but basically the array is ordered so
|
||||||
|
// the first dir requires an offset of 2, and the second dir
|
||||||
|
// requires an offset of 8, plus the initial offset for the
|
||||||
|
// corner.
|
||||||
|
ret[idx] = submapOffsets[idx] + (connected(dirs[0]) ? 2 : 0) + (connected(dirs[1]) ? 8 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dir The direction to check connection in.
|
||||||
|
* @return True if the cached connectionMap holds a connection in this {@link Dir direction}.
|
||||||
|
*/
|
||||||
|
public boolean connected(Dir dir) {
|
||||||
|
return connectionMap.get(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dirs The directions to check connection in.
|
||||||
|
* @return True if the cached connectionMap holds a connection in <i><b>all</b></i> the given {@link Dir
|
||||||
|
* directions}.
|
||||||
|
*/
|
||||||
|
public boolean connectedAnd(Dir... dirs) {
|
||||||
|
for (Dir dir : dirs) {
|
||||||
|
if (!connected(dir)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dirs The directions to check connection in.
|
||||||
|
* @return True if the cached connectionMap holds a connection in <i><b>one of</b></i> the given {@link Dir
|
||||||
|
* directions}.
|
||||||
|
*/
|
||||||
|
private boolean connectedOr(Dir... dirs) {
|
||||||
|
for (Dir dir : dirs) {
|
||||||
|
if (connected(dir)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A check for if the block being rendered can connect to the given location on the given side. Passes the block
|
||||||
|
* being rendered on to {@link IFacade} blocks, so they can decide per neighbour.
|
||||||
|
*
|
||||||
|
* @param world
|
||||||
|
* @param x The x coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param y The y coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param z The z coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param side The side of the block to check for connection status. This is <i>not</i> the direction to check in.
|
||||||
|
* @param fromX The x coordinate of your block, the block being rendered.
|
||||||
|
* @param fromY The y coordinate of your block, the block being rendered.
|
||||||
|
* @param fromZ The z coordinate of your block, the block being rendered.
|
||||||
|
* @param block The block being rendered.
|
||||||
|
* @param meta The metadata of the block being rendered.
|
||||||
|
* @return True if the given block can connect to the given location on the given side.
|
||||||
|
*/
|
||||||
|
public boolean isConnected(IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY, int fromZ,
|
||||||
|
Block block, int meta) {
|
||||||
|
ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[side];
|
||||||
|
return isConnected(world, x, y, z, dir, fromX, fromY, fromZ, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A check for if the block being rendered can connect to the given location on the given side. Passes the block
|
||||||
|
* being rendered on to {@link IFacade} blocks, so they can decide per neighbour.
|
||||||
|
*
|
||||||
|
* @param world
|
||||||
|
* @param x The x coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param y The y coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param z The z coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param dir The {@link ForgeDirection side} of the block to check for connection status. This is <i>not</i> the
|
||||||
|
* direction to check in.
|
||||||
|
* @param fromX The x coordinate of your block, the block being rendered.
|
||||||
|
* @param fromY The y coordinate of your block, the block being rendered.
|
||||||
|
* @param fromZ The z coordinate of your block, the block being rendered.
|
||||||
|
* @param block The block being rendered.
|
||||||
|
* @param meta The metadata of the block being rendered.
|
||||||
|
* @return True if the given block can connect to the given location on the given side.
|
||||||
|
*/
|
||||||
|
public boolean isConnected(IBlockAccess world, int x, int y, int z, ForgeDirection dir, int fromX, int fromY,
|
||||||
|
int fromZ, Block block, int meta) {
|
||||||
|
if (CTMLib.chiselLoaded() && connectionBlocked(world, x, y, z, dir.ordinal())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!matches(world, x, y, z, dir.ordinal(), fromX, fromY, fromZ, block, meta)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disableObscuredFaceCheck.or(disableObscuredFaceCheckConfig)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check that we aren't already connected outwards from this side
|
||||||
|
int x2 = x + dir.offsetX;
|
||||||
|
int y2 = y + dir.offsetY;
|
||||||
|
int z2 = z + dir.offsetZ;
|
||||||
|
return !matches(world, x2, y2, z2, dir.ordinal(), fromX, fromY, fromZ, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the given location shows the block being rendered, as seen from the block being rendered. Asks the world
|
||||||
|
* if it is an {@link IConnectionAccess}, otherwise compares the block or {@link IFacade} at that location.
|
||||||
|
*
|
||||||
|
* @param world
|
||||||
|
* @param x The x coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param y The y coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param z The z coordinate of the block to check <i>against</i>. This is not the position of your block.
|
||||||
|
* @param side The side being rendered. -1 for unknown.
|
||||||
|
* @param fromX The x coordinate of your block, the block being rendered.
|
||||||
|
* @param fromY The y coordinate of your block, the block being rendered.
|
||||||
|
* @param fromZ The z coordinate of your block, the block being rendered.
|
||||||
|
* @param block The block being rendered.
|
||||||
|
* @param meta The metadata of the block being rendered.
|
||||||
|
* @return True if the given location shows the given block and metadata.
|
||||||
|
*/
|
||||||
|
public boolean matches(IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY, int fromZ,
|
||||||
|
Block block, int meta) {
|
||||||
|
if (CTMLib.chiselLoaded()) {
|
||||||
|
return matchesAccess(world, x, y, z, side, fromX, fromY, fromZ, block, meta);
|
||||||
|
}
|
||||||
|
return block.equals(world.getBlock(x, y, z)) && world.getBlockMetadata(x, y, z) == meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean matchesAccess(IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY, int fromZ,
|
||||||
|
Block block, int meta) {
|
||||||
|
if (world instanceof IConnectionAccess) {
|
||||||
|
return ((IConnectionAccess) world).matches(x, y, z, side, fromX, fromY, fromZ, block, meta);
|
||||||
|
}
|
||||||
|
Block blk = world.getBlock(x, y, z);
|
||||||
|
Block con = getFacade(blk, world, x, y, z, side, fromX, fromY, fromZ, block, meta);
|
||||||
|
|
||||||
|
// no block or a bad API user
|
||||||
|
if (con == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return con.equals(block) && getFacadeMeta(blk, world, x, y, z, side, fromX, fromY, fromZ, block, meta) == meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean connectionBlocked(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
if (block instanceof IConnectable) {
|
||||||
|
return !((IConnectable) block).canConnectCTM(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A utility method to access metadata from both the world and {@link IFacade} blocks in the world.
|
||||||
|
*
|
||||||
|
* @param world
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @param z
|
||||||
|
* @param side The side to check for. -1 for unknown.
|
||||||
|
* @return The metadata at this position in the world, or inside an {@link IFacade} block.
|
||||||
|
*/
|
||||||
|
public int getBlockOrFacadeMetadata(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
Block blk = world.getBlock(x, y, z);
|
||||||
|
if (CTMLib.chiselLoaded()) {
|
||||||
|
return getFacadeMeta(blk, world, x, y, z, side);
|
||||||
|
}
|
||||||
|
return world.getBlockMetadata(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getFacadeMeta(Block blk, IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
if (blk instanceof IFacade) {
|
||||||
|
return ((IFacade) blk).getFacadeMetadata(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
return world.getBlockMetadata(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A utility method to access a block from both the world and {@link IFacade} blocks in the world.
|
||||||
|
*
|
||||||
|
* @param world
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @param z
|
||||||
|
* @param side The side to check for. -1 for unknown.
|
||||||
|
* @return The block at this position in the world, or inside an {@link IFacade} block.
|
||||||
|
*/
|
||||||
|
public Block getBlockOrFacade(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
Block blk = world.getBlock(x, y, z);
|
||||||
|
if (CTMLib.chiselLoaded()) {
|
||||||
|
return getFacade(blk, world, x, y, z, side);
|
||||||
|
}
|
||||||
|
return blk;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Block getFacade(Block blk, IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
if (blk instanceof IFacade) {
|
||||||
|
blk = ((IFacade) blk).getFacade(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
return blk;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getFacadeMeta(Block blk, IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY,
|
||||||
|
int fromZ, Block fromBlock, int fromMeta) {
|
||||||
|
if (blk instanceof IFacade) {
|
||||||
|
return ((IFacade) blk).getFacadeMetadata(world, x, y, z, side, fromX, fromY, fromZ, fromBlock, fromMeta);
|
||||||
|
}
|
||||||
|
return world.getBlockMetadata(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Block getFacade(Block blk, IBlockAccess world, int x, int y, int z, int side, int fromX, int fromY,
|
||||||
|
int fromZ, Block fromBlock, int fromMeta) {
|
||||||
|
if (blk instanceof IFacade) {
|
||||||
|
blk = ((IFacade) blk).getFacade(world, x, y, z, side, fromX, fromY, fromZ, fromBlock, fromMeta);
|
||||||
|
}
|
||||||
|
return blk;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience implementation of ICMBlock. This does everything you should need for basic CTM.
|
||||||
|
* <p>
|
||||||
|
* This class does <i>not</i> handle metadata-dependent textures.
|
||||||
|
*/
|
||||||
|
public class CTMBlock extends Block implements ICTMBlock<ISubmapManager> {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private SubmapManagerCTM manager;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final String modid;
|
||||||
|
@Getter
|
||||||
|
private final String texturePath;
|
||||||
|
|
||||||
|
private final int renderId;
|
||||||
|
|
||||||
|
public CTMBlock(String modid, String texturePath, int renderId) {
|
||||||
|
super(Material.rock);
|
||||||
|
this.modid = modid;
|
||||||
|
this.texturePath = texturePath;
|
||||||
|
this.renderId = renderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister icon) {
|
||||||
|
manager = new SubmapManagerCTM(texturePath);
|
||||||
|
manager.registerIcons(modid, this, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
return manager.getIcon(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
return manager.getIcon(side, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getRenderType() {
|
||||||
|
return renderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ISubmapManager getManager(IBlockAccess world, int x, int y, int z, int meta) {
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ISubmapManager getManager(int meta) {
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.ModAPIManager;
|
||||||
|
import team.chisel.Tags;
|
||||||
|
|
||||||
|
public class CTMLib {
|
||||||
|
|
||||||
|
public static final String VERSION = Tags.VERSION;
|
||||||
|
|
||||||
|
private static boolean chiselPresent, chiselInitialized;
|
||||||
|
|
||||||
|
public static boolean chiselLoaded() {
|
||||||
|
if (!chiselInitialized) {
|
||||||
|
chiselInitialized = true;
|
||||||
|
chiselPresent = ModAPIManager.INSTANCE.hasAPI("ChiselAPI");
|
||||||
|
}
|
||||||
|
return chiselPresent;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
|
import net.minecraft.util.ReportedException;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A convenience base class for CTM blocks. Any block using this must implement {@link ICTMBlock}.
|
||||||
|
*/
|
||||||
|
public class CTMRenderer implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
|
private final int renderId;
|
||||||
|
|
||||||
|
public CTMRenderer(int renderId) {
|
||||||
|
this.renderId = renderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||||
|
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||||
|
final WorldClient world = Minecraft.getMinecraft().theWorld;
|
||||||
|
final RenderBlocks rb = getContext(renderer, block, world, ((ICTMBlock<?>) block).getManager(metadata));
|
||||||
|
boolean clean = false;
|
||||||
|
if (rb.blockAccess == null) {
|
||||||
|
rb.blockAccess = world;
|
||||||
|
clean = true;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Drawing.drawBlock(block, metadata, rb);
|
||||||
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
|
rb.unlockBlockBounds();
|
||||||
|
} finally {
|
||||||
|
if (clean) rb.blockAccess = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
|
RenderBlocks renderer) {
|
||||||
|
final int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
final RenderBlocks rb = getContext(
|
||||||
|
renderer,
|
||||||
|
block,
|
||||||
|
world,
|
||||||
|
((ICTMBlock<?>) block).getManager(world, x, y, z, meta));
|
||||||
|
boolean clean = false;
|
||||||
|
if (rb.blockAccess == null) {
|
||||||
|
rb.blockAccess = world;
|
||||||
|
clean = true;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
rb.renderAllFaces = renderer.renderAllFaces;
|
||||||
|
boolean ret = rb.renderStandardBlock(block, x, y, z);
|
||||||
|
rb.unlockBlockBounds();
|
||||||
|
rb.renderAllFaces = false;
|
||||||
|
return ret;
|
||||||
|
} catch (Throwable t) {
|
||||||
|
CrashReport crashreport = CrashReport.makeCrashReport(t, "Rendering CTM Block");
|
||||||
|
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being rendered");
|
||||||
|
crashreportcategory.addCrashSection("Block name", GameRegistry.findUniqueIdentifierFor(block));
|
||||||
|
crashreportcategory.addCrashSection("Block metadata", world.getBlockMetadata(x, y, z));
|
||||||
|
throw new ReportedException(crashreport);
|
||||||
|
} finally {
|
||||||
|
if (clean) rb.blockAccess = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private RenderBlocks getContext(RenderBlocks rendererOld, Block block, IBlockAccess world, ISubmapManager manager) {
|
||||||
|
if (!rendererOld.hasOverrideBlockTexture() && manager != null) {
|
||||||
|
RenderBlocks rb = manager.createRenderContext(rendererOld, block, world);
|
||||||
|
if (rb != null && rb != rendererOld) {
|
||||||
|
if (rendererOld.lockBlockBounds) {
|
||||||
|
rb.overrideBlockBounds(
|
||||||
|
rendererOld.renderMinX,
|
||||||
|
rendererOld.renderMinY,
|
||||||
|
rendererOld.renderMinZ,
|
||||||
|
rendererOld.renderMaxX,
|
||||||
|
rendererOld.renderMaxY,
|
||||||
|
rendererOld.renderMaxZ);
|
||||||
|
}
|
||||||
|
if (rb instanceof RenderBlocksCTM rbctm) {
|
||||||
|
rbctm.manager = rbctm.manager == null ? manager : rbctm.manager;
|
||||||
|
}
|
||||||
|
return rb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rendererOld;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRender3DInInventory(int renderId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderId() {
|
||||||
|
return renderId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||||
|
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||||
|
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||||
|
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||||
|
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||||
|
import static net.minecraftforge.common.util.ForgeDirection.getOrientation;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Think of this class as a "Two dimensional ForgeDirection, with diagonals".
|
||||||
|
* <p>
|
||||||
|
* It represents the eight different directions a face of a block can connect with CTM, and contains the logic for
|
||||||
|
* determining if a block is indeed connected in that direction.
|
||||||
|
* <p>
|
||||||
|
* Note that, for example, {@link #TOP_RIGHT} does not mean connected to the {@link #TOP} and {@link #RIGHT}, but
|
||||||
|
* connected in the diagonal direction represented by {@link #TOP_RIGHT}. This is used for inner corner rendering.
|
||||||
|
*/
|
||||||
|
public enum Dir {
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
|
TOP(UP),
|
||||||
|
TOP_RIGHT(UP, EAST),
|
||||||
|
RIGHT(EAST),
|
||||||
|
BOTTOM_RIGHT(DOWN, EAST),
|
||||||
|
BOTTOM(DOWN),
|
||||||
|
BOTTOM_LEFT(DOWN, WEST),
|
||||||
|
LEFT(WEST),
|
||||||
|
TOP_LEFT(UP, WEST);
|
||||||
|
// @formatter:on
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All values of this enum, used to prevent unnecessary allocation via {@link #values()}.
|
||||||
|
*/
|
||||||
|
public static final Dir[] VALUES = values();
|
||||||
|
private static final ForgeDirection NORMAL = SOUTH;
|
||||||
|
|
||||||
|
private ForgeDirection[] dirs;
|
||||||
|
|
||||||
|
private Dir(ForgeDirection... dirs) {
|
||||||
|
this.dirs = dirs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds if this block is connected for the given side in this Dir.
|
||||||
|
*
|
||||||
|
* @param inst The CTM instance to use for logic.
|
||||||
|
* @param world The world the block is in.
|
||||||
|
* @param x The x coordinate of your block.
|
||||||
|
* @param y The y coordinate of your block.
|
||||||
|
* @param z The z coordinate of your block.
|
||||||
|
* @param sideIdx The side index of the current face. This equivalent to {@link ForgeDirection#ordinal()}
|
||||||
|
* @param block The block being rendered.
|
||||||
|
* @param meta The metadata of the block.
|
||||||
|
* @return True if the block is connected in the given Dir, false otherwise.
|
||||||
|
*/
|
||||||
|
public boolean isConnected(CTM inst, IBlockAccess world, int x, int y, int z, int sideIdx, Block block, int meta) {
|
||||||
|
ForgeDirection side = getOrientation(sideIdx);
|
||||||
|
ForgeDirection[] dirs = getNormalizedDirs(side);
|
||||||
|
int fromX = x;
|
||||||
|
int fromY = y;
|
||||||
|
int fromZ = z;
|
||||||
|
for (ForgeDirection dir : dirs) {
|
||||||
|
x += dir.offsetX;
|
||||||
|
y += dir.offsetY;
|
||||||
|
z += dir.offsetZ;
|
||||||
|
}
|
||||||
|
return inst.isConnected(world, x, y, z, side, fromX, fromY, fromZ, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ForgeDirection[] getNormalizedDirs(ForgeDirection normal) {
|
||||||
|
if (normal == NORMAL) {
|
||||||
|
return dirs;
|
||||||
|
} else if (normal == NORMAL.getOpposite()) {
|
||||||
|
// If this is the opposite direction of the default normal, we
|
||||||
|
// need to mirror the dirs
|
||||||
|
// A mirror version does not affect y+ and y- so we ignore those
|
||||||
|
ForgeDirection[] ret = new ForgeDirection[dirs.length];
|
||||||
|
for (int i = 0; i < ret.length; i++) {
|
||||||
|
ret[i] = dirs[i].offsetY != 0 ? dirs[i] : dirs[i].getOpposite();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
} else {
|
||||||
|
ForgeDirection axis = null;
|
||||||
|
// Next, we need different a different rotation axis depending
|
||||||
|
// on if this is up/down or not
|
||||||
|
if (normal.offsetY == 0) {
|
||||||
|
// If it is not up/down, pick either the left or right-hand
|
||||||
|
// rotation
|
||||||
|
axis = normal == NORMAL.getRotation(UP) ? UP : DOWN;
|
||||||
|
} else {
|
||||||
|
// If it is up/down, pick either the up or down rotation.
|
||||||
|
axis = normal == UP ? NORMAL.getRotation(DOWN) : NORMAL.getRotation(UP);
|
||||||
|
}
|
||||||
|
ForgeDirection[] ret = new ForgeDirection[dirs.length];
|
||||||
|
// Finally apply all the rotations
|
||||||
|
for (int i = 0; i < ret.length; i++) {
|
||||||
|
ret[i] = dirs[i].getRotation(axis);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class Drawing {
|
||||||
|
|
||||||
|
public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||||
|
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon);
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||||
|
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon);
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||||
|
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon);
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||||
|
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon);
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||||
|
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon);
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||||
|
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawBlock(Block block, int meta, RenderBlocks renderer) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||||
|
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||||
|
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||||
|
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||||
|
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||||
|
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
|
||||||
|
tessellator.draw();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||||
|
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void renderAllFaces(RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) {
|
||||||
|
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||||
|
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||||
|
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||||
|
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||||
|
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||||
|
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
public interface ICTMBlock<T extends ISubmapManager> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the {@link ISubmapManager} for this block in the world.
|
||||||
|
*/
|
||||||
|
T getManager(IBlockAccess world, int x, int y, int z, int meta);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the {@link ISubmapManager} for this block in item form.
|
||||||
|
*
|
||||||
|
* @param meta The meta (damage) of the stack.
|
||||||
|
*/
|
||||||
|
T getManager(int meta);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public interface ISubmap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The width, in icons, of the submap.
|
||||||
|
*/
|
||||||
|
int getWidth();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The height, in icons, of the submap.
|
||||||
|
*/
|
||||||
|
int getHeight();
|
||||||
|
|
||||||
|
IIcon getSubIcon(int x, int y);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public interface ISubmapManager {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the icon for item rendering, based on side and item metadata.
|
||||||
|
*
|
||||||
|
* @param side Side of the ItemBlock.
|
||||||
|
* @param meta Metadata of the ItemBlock.
|
||||||
|
* @return The IIcon for rendering.
|
||||||
|
*/
|
||||||
|
IIcon getIcon(int side, int meta);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the icon for world rendering, based on world position and side.
|
||||||
|
*/
|
||||||
|
IIcon getIcon(IBlockAccess world, int x, int y, int z, int side);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook for registering any custom icons you might need in this class. Will be called during the normal block
|
||||||
|
* method.
|
||||||
|
*
|
||||||
|
* @param modName The mod ID this submap was registered to.
|
||||||
|
* @param block The block being registered for.
|
||||||
|
* @param register The IIconRegister instance.
|
||||||
|
*/
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
void registerIcons(String modName, Block block, IIconRegister register);
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world);
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side);
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side);
|
||||||
|
}
|
||||||
@@ -0,0 +1,678 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XNEG_LB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XNEG_LT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XNEG_RB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XNEG_RT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XPOS_LB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XPOS_LT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XPOS_RB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.XPOS_RT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YNEG_LB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YNEG_LT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YNEG_RB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YNEG_RT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YPOS_LB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YPOS_LT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YPOS_RB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.YPOS_RT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZNEG_LB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZNEG_LT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZNEG_RB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZNEG_RT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZPOS_LB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZPOS_LT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZPOS_RB;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.SubSide.ZPOS_RT;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.X;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XY;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XYZ;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XY_HALF;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XY_HALF_Z;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XZ;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XZ_HALF;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.XZ_HALF_Y;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.X_HALF;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.X_HALF_Y;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.X_HALF_YZ;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.X_HALF_Z;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Y;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.YZ;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.YZ_HALF;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.YZ_HALF_X;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Y_HALF;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Y_HALF_X;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Y_HALF_XZ;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Y_HALF_Z;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Z;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.ZERO;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Z_HALF;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Z_HALF_X;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Z_HALF_XY;
|
||||||
|
import static team.chisel.ctmlib.RenderBlocksCTM.Vert.Z_HALF_Y;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.IConnectionAccess;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
public class RenderBlocksCTM extends RenderBlocks {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An enum for all possible 26 sub-side vertices.
|
||||||
|
*
|
||||||
|
* The naming scheme is as follows:
|
||||||
|
*
|
||||||
|
* ZERO is a special case, it is the absolute min point of the block. X, Y, Z, or any combination means that the
|
||||||
|
* axes listed in the name are at 1. X, Y, Z, or any combination followed by HALF means that those axes are at 0.5.
|
||||||
|
* X, Y, Z, or any combination after a HALF means those axes are at 1.
|
||||||
|
*/
|
||||||
|
protected enum Vert {
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
|
ZERO(0, 0, 0),
|
||||||
|
XYZ(1, 1, 1),
|
||||||
|
X(1, 0, 0),
|
||||||
|
Y(0, 1, 0),
|
||||||
|
Z(0, 0, 1),
|
||||||
|
XY(1, 1, 0),
|
||||||
|
YZ(0, 1, 1),
|
||||||
|
XZ(1, 0, 1),
|
||||||
|
X_HALF(0.5, 0, 0),
|
||||||
|
Y_HALF(0, 0.5, 0),
|
||||||
|
Z_HALF(0, 0, 0.5),
|
||||||
|
XY_HALF(0.5, 0.5, 0),
|
||||||
|
YZ_HALF(0, 0.5, 0.5),
|
||||||
|
XZ_HALF(0.5, 0, 0.5),
|
||||||
|
X_HALF_Y(0.5, 1, 0),
|
||||||
|
X_HALF_Z(0.5, 0, 1),
|
||||||
|
Y_HALF_X(1, 0.5, 0),
|
||||||
|
Y_HALF_Z(0, 0.5, 1),
|
||||||
|
Z_HALF_X(1, 0, 0.5),
|
||||||
|
Z_HALF_Y(0, 1, 0.5),
|
||||||
|
X_HALF_YZ(0.5, 1, 1),
|
||||||
|
Y_HALF_XZ(1, 0.5, 1),
|
||||||
|
Z_HALF_XY(1, 1, 0.5),
|
||||||
|
XY_HALF_Z(0.5, 0.5, 1),
|
||||||
|
YZ_HALF_X(1, 0.5, 0.5),
|
||||||
|
XZ_HALF_Y(0.5, 1, 0.5);
|
||||||
|
// @formatter:on
|
||||||
|
|
||||||
|
private final double x, y, z;
|
||||||
|
|
||||||
|
Vert(double x, double y, double z) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
double get(int axis) {
|
||||||
|
return axis == 0 ? x : axis == 1 ? y : z;
|
||||||
|
}
|
||||||
|
|
||||||
|
void render(RenderBlocksCTM inst, SubSide side, int cacheID) {
|
||||||
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
final ForgeDirection normal = side.normal;
|
||||||
|
|
||||||
|
if (inst.enableAO) {
|
||||||
|
tessellator.setColorOpaque_F(inst.redCache[cacheID], inst.grnCache[cacheID], inst.bluCache[cacheID]);
|
||||||
|
tessellator.setBrightness(inst.lightingCache[cacheID]);
|
||||||
|
}
|
||||||
|
|
||||||
|
double u = cacheID == 1 || cacheID == 2 ? inst.maxU : inst.minU;
|
||||||
|
double v = cacheID < 2 ? inst.maxV : inst.minV;
|
||||||
|
|
||||||
|
if (inst.renderPart) {
|
||||||
|
// only the part inside the bounds, showing the texture where it lies in the block
|
||||||
|
double px = Math.min(Math.max(x, inst.renderMinX), inst.renderMaxX);
|
||||||
|
double py = Math.min(Math.max(y, inst.renderMinY), inst.renderMaxY);
|
||||||
|
double pz = Math.min(Math.max(z, inst.renderMinZ), inst.renderMaxZ);
|
||||||
|
double uMoved = Math.abs(normal.offsetX != 0 ? pz - z : px - x);
|
||||||
|
double vMoved = Math.abs(normal.offsetY != 0 ? pz - z : py - y);
|
||||||
|
// a sub-side is half a block wide
|
||||||
|
u += (u == inst.minU ? 2 : -2) * (inst.maxU - inst.minU) * uMoved;
|
||||||
|
v += (v == inst.minV ? 2 : -2) * (inst.maxV - inst.minV) * vMoved;
|
||||||
|
if (inst.enableAO) {
|
||||||
|
// the caches hold the light at the sub-side's corners, the vertex moved, so take the light there
|
||||||
|
double lightX = inst.boundsFraction(side.lightAxisX, px, py, pz);
|
||||||
|
double lightY = inst.boundsFraction(side.lightAxisY, px, py, pz);
|
||||||
|
inst.mixLight(side.lightRisingX ? lightX : 1 - lightX, side.lightRisingY ? lightY : 1 - lightY);
|
||||||
|
}
|
||||||
|
tessellator.addVertexWithUV(px, py, pz, u, v);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double uDiff = inst.maxU - inst.minU;
|
||||||
|
double vDiff = inst.maxV - inst.minV;
|
||||||
|
|
||||||
|
double xDiff;
|
||||||
|
double yDiff;
|
||||||
|
double zDiff;
|
||||||
|
if (inst.renderMinX + inst.renderMinY + inst.renderMinZ != 0
|
||||||
|
|| inst.renderMaxX + inst.renderMaxY + inst.renderMaxZ != 3) {
|
||||||
|
boolean uMin = u == inst.minU;
|
||||||
|
boolean vMin = v == inst.minV;
|
||||||
|
|
||||||
|
xDiff = inst.renderMaxX - inst.renderMinX;
|
||||||
|
yDiff = inst.renderMaxY - inst.renderMinY;
|
||||||
|
zDiff = inst.renderMaxZ - inst.renderMinZ;
|
||||||
|
|
||||||
|
if (normal.offsetY != 0) {
|
||||||
|
uDiff *= uMin ? inst.renderMinX : 1 - inst.renderMaxX;
|
||||||
|
vDiff *= vMin ? inst.renderMinZ : 1 - inst.renderMaxZ;
|
||||||
|
} else if (normal.offsetX != 0) {
|
||||||
|
uDiff *= uMin ? inst.renderMinZ : 1 - inst.renderMaxZ;
|
||||||
|
vDiff *= vMin ? inst.renderMinY : 1 - inst.renderMaxY;
|
||||||
|
} else if (normal.offsetZ != 0) {
|
||||||
|
uDiff *= uMin ? inst.renderMinX : 1 - inst.renderMaxX;
|
||||||
|
vDiff *= vMin ? inst.renderMinY : 1 - inst.renderMaxY;
|
||||||
|
}
|
||||||
|
u = u == inst.minU ? inst.minU + uDiff : inst.maxU - uDiff;
|
||||||
|
|
||||||
|
v = v == inst.minV ? inst.minV + vDiff : inst.maxV - vDiff;
|
||||||
|
} else {
|
||||||
|
xDiff = yDiff = zDiff = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tessellator.addVertexWithUV(
|
||||||
|
inst.renderMinX + (x * xDiff),
|
||||||
|
inst.renderMinY + (y * yDiff),
|
||||||
|
inst.renderMinZ + (z * zDiff),
|
||||||
|
u,
|
||||||
|
v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Each side is divided into 4 sub-sides. LB(left bottom), RB(right bottom), LT(right top), and RT(right top).
|
||||||
|
*
|
||||||
|
* Each sub-side contains 4 {@link Vert} objects representing its position on the block.
|
||||||
|
*/
|
||||||
|
protected enum SubSide {
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
|
XNEG_LB(ZERO, Z_HALF, YZ_HALF, Y_HALF), XNEG_RB(Z_HALF, Z, Y_HALF_Z, YZ_HALF), XNEG_RT(YZ_HALF, Y_HALF_Z, YZ, Z_HALF_Y), XNEG_LT(Y_HALF, YZ_HALF, Z_HALF_Y, Y),
|
||||||
|
XPOS_LB(XZ, Z_HALF_X, YZ_HALF_X, Y_HALF_XZ), XPOS_RB(Z_HALF_X, X, Y_HALF_X, YZ_HALF_X), XPOS_RT(YZ_HALF_X, Y_HALF_X, XY, Z_HALF_XY), XPOS_LT(Y_HALF_XZ, YZ_HALF_X, Z_HALF_XY, XYZ),
|
||||||
|
|
||||||
|
ZNEG_LB(X, X_HALF, XY_HALF, Y_HALF_X), ZNEG_RB(X_HALF, ZERO, Y_HALF, XY_HALF), ZNEG_RT(XY_HALF, Y_HALF, Y, X_HALF_Y), ZNEG_LT(Y_HALF_X, XY_HALF, X_HALF_Y, XY),
|
||||||
|
ZPOS_LB(Z, X_HALF_Z, XY_HALF_Z, Y_HALF_Z), ZPOS_RB(X_HALF_Z, XZ, Y_HALF_XZ, XY_HALF_Z), ZPOS_RT(XY_HALF_Z, Y_HALF_XZ, XYZ, X_HALF_YZ), ZPOS_LT(Y_HALF_Z, XY_HALF_Z, X_HALF_YZ, YZ),
|
||||||
|
|
||||||
|
YNEG_LB(ZERO, X_HALF, XZ_HALF, Z_HALF), YNEG_RB(X_HALF, X, Z_HALF_X, XZ_HALF), YNEG_RT(XZ_HALF, Z_HALF_X, XZ, X_HALF_Z), YNEG_LT(Z_HALF, XZ_HALF, X_HALF_Z, Z),
|
||||||
|
YPOS_LB(YZ, X_HALF_YZ, XZ_HALF_Y, Z_HALF_Y), YPOS_RB(X_HALF_YZ, XYZ, Z_HALF_XY, XZ_HALF_Y), YPOS_RT(XZ_HALF_Y, Z_HALF_XY, XY, X_HALF_Y), YPOS_LT(Z_HALF_Y, XZ_HALF_Y, X_HALF_Y, Y);
|
||||||
|
// @formatter:on
|
||||||
|
private final Vert xmin, xmax, ymin, ymax;
|
||||||
|
private final ForgeDirection normal;
|
||||||
|
/** The block axes the light maps' x and y run along, and whether they run towards 1. */
|
||||||
|
private final int lightAxisX, lightAxisY;
|
||||||
|
private final boolean lightRisingX, lightRisingY;
|
||||||
|
|
||||||
|
SubSide(Vert xmin, Vert ymin, Vert ymax, Vert xmax) {
|
||||||
|
this.xmin = xmin;
|
||||||
|
this.ymin = ymin;
|
||||||
|
this.ymax = ymax;
|
||||||
|
this.xmax = xmax;
|
||||||
|
this.normal = calcNormal();
|
||||||
|
// the caches step along the light maps' x from xmin to ymin, and along their y from xmin to xmax
|
||||||
|
this.lightAxisX = axis(xmin, ymin);
|
||||||
|
this.lightAxisY = axis(xmin, xmax);
|
||||||
|
this.lightRisingX = ymin.get(lightAxisX) > xmin.get(lightAxisX);
|
||||||
|
this.lightRisingY = xmax.get(lightAxisY) > xmin.get(lightAxisY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int axis(Vert from, Vert to) {
|
||||||
|
return from.x != to.x ? 0 : from.y != to.y ? 1 : 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ForgeDirection calcNormal() {
|
||||||
|
double xTot = xmin.x + xmax.x + ymin.x + ymax.x;
|
||||||
|
double yTot = xmin.y + xmax.y + ymin.y + ymax.y;
|
||||||
|
double zTot = xmin.z + xmax.z + ymin.z + ymax.z;
|
||||||
|
if (xTot % 4 == 0) {
|
||||||
|
return xTot > 0 ? ForgeDirection.EAST : ForgeDirection.WEST;
|
||||||
|
} else if (yTot % 4 == 0) {
|
||||||
|
return yTot > 0 ? ForgeDirection.UP : ForgeDirection.DOWN;
|
||||||
|
} else if (zTot % 4 == 0) {
|
||||||
|
return zTot > 0 ? ForgeDirection.SOUTH : ForgeDirection.NORTH;
|
||||||
|
}
|
||||||
|
return ForgeDirection.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
void render(RenderBlocksCTM inst) {
|
||||||
|
xmin.render(inst, this, 0);
|
||||||
|
ymin.render(inst, this, 1);
|
||||||
|
ymax.render(inst, this, 2);
|
||||||
|
xmax.render(inst, this, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CTM ctm = CTM.getInstance();
|
||||||
|
|
||||||
|
// globals added to save the JVM some trouble. No need to constantly create
|
||||||
|
// and destroy ints if we don't have to
|
||||||
|
protected int blockLightBitChannel = 0;
|
||||||
|
protected int redBitChannel = 0;
|
||||||
|
protected int greenBitChannel = 0;
|
||||||
|
protected int blueBitChannel = 0;
|
||||||
|
protected int sunlightBitChannel = 0;
|
||||||
|
|
||||||
|
public RenderBlocksCTM() {
|
||||||
|
super();
|
||||||
|
renderMaxX = renderMaxY = renderMaxZ = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected double minU, maxU;
|
||||||
|
protected double minV, maxV;
|
||||||
|
protected int[] lightingCache = new int[4];
|
||||||
|
protected float[] redCache = new float[4];
|
||||||
|
protected float[] grnCache = new float[4];
|
||||||
|
protected float[] bluCache = new float[4];
|
||||||
|
public TextureSubmap submap;
|
||||||
|
public TextureSubmap submapSmall;
|
||||||
|
public ISubmapManager manager;
|
||||||
|
|
||||||
|
protected int[][] lightmap = new int[3][3];
|
||||||
|
protected float[][] redmap = new float[3][3];
|
||||||
|
protected float[][] grnmap = new float[3][3];
|
||||||
|
protected float[][] blumap = new float[3][3];
|
||||||
|
|
||||||
|
protected int bx, by, bz, meta;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
protected boolean inWorld = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the render bounds are a part of the block, which shows its part of the block's texture instead of the
|
||||||
|
* whole texture squeezed in. Set when rendering in an {@link IConnectionAccess}.
|
||||||
|
*/
|
||||||
|
protected boolean renderPart = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderStandardBlock(Block block, int x, int y, int z) {
|
||||||
|
bx = x;
|
||||||
|
by = y;
|
||||||
|
bz = z;
|
||||||
|
meta = Minecraft.getMinecraft().theWorld.getBlockMetadata(x, y, z);
|
||||||
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
|
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||||
|
tessellator.addTranslation(x, y, z);
|
||||||
|
inWorld = true;
|
||||||
|
renderPart = CTMLib.chiselLoaded() && blockAccess instanceof IConnectionAccess;
|
||||||
|
boolean res = super.renderStandardBlock(block, x, y, z);
|
||||||
|
renderPart = false;
|
||||||
|
inWorld = false;
|
||||||
|
tessellator.addTranslation(-x, -y, -z);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @formatter:off
|
||||||
|
* This method fills a 3x3 grid of light values based on the four corners, by averaging them together.
|
||||||
|
*
|
||||||
|
* 2 TL x TR
|
||||||
|
*
|
||||||
|
* 1 x x x
|
||||||
|
*
|
||||||
|
* 0 BL x BR
|
||||||
|
* 0 1 2
|
||||||
|
*
|
||||||
|
* Note: Variable names mean nothing... don't touch
|
||||||
|
*
|
||||||
|
* ._.
|
||||||
|
*
|
||||||
|
* shakes fist in anger
|
||||||
|
*/
|
||||||
|
// @formatter:on
|
||||||
|
protected void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) {
|
||||||
|
lightmap[0][0] = bottomLeft;
|
||||||
|
lightmap[2][0] = bottomRight;
|
||||||
|
lightmap[2][2] = topRight;
|
||||||
|
lightmap[0][2] = topLeft;
|
||||||
|
|
||||||
|
lightmap[1][0] = avg(bottomLeft, bottomRight);
|
||||||
|
lightmap[2][1] = avg(bottomRight, topRight);
|
||||||
|
lightmap[1][2] = avg(topRight, topLeft);
|
||||||
|
lightmap[0][1] = avg(topLeft, bottomLeft);
|
||||||
|
|
||||||
|
lightmap[1][1] = avg(bottomLeft, bottomRight, topRight, topLeft);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fillColormap(float bottomLeft, float bottomRight, float topRight, float topLeft, float[][] map) {
|
||||||
|
map[0][0] = bottomLeft;
|
||||||
|
map[2][0] = bottomRight;
|
||||||
|
map[2][2] = topRight;
|
||||||
|
map[0][2] = topLeft;
|
||||||
|
|
||||||
|
map[1][0] = (bottomLeft + bottomRight) / 2.0F;
|
||||||
|
map[2][1] = (bottomRight + topRight) / 2.0F;
|
||||||
|
map[1][2] = (topRight + topLeft) / 2.0F;
|
||||||
|
map[0][1] = (topLeft + bottomLeft) / 2.0F;
|
||||||
|
|
||||||
|
map[1][1] = (bottomLeft + bottomRight + topRight + topLeft) / 4.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getLight(int x, int y) {
|
||||||
|
lightingCache[0] = lightmap[0 + x][0 + y];
|
||||||
|
lightingCache[1] = lightmap[1 + x][0 + y];
|
||||||
|
lightingCache[2] = lightmap[1 + x][1 + y];
|
||||||
|
lightingCache[3] = lightmap[0 + x][1 + y];
|
||||||
|
|
||||||
|
redCache[0] = redmap[0 + x][0 + y];
|
||||||
|
redCache[1] = redmap[1 + x][0 + y];
|
||||||
|
redCache[2] = redmap[1 + x][1 + y];
|
||||||
|
redCache[3] = redmap[0 + x][1 + y];
|
||||||
|
|
||||||
|
grnCache[0] = grnmap[0 + x][0 + y];
|
||||||
|
grnCache[1] = grnmap[1 + x][0 + y];
|
||||||
|
grnCache[2] = grnmap[1 + x][1 + y];
|
||||||
|
grnCache[3] = grnmap[0 + x][1 + y];
|
||||||
|
|
||||||
|
bluCache[0] = blumap[0 + x][0 + y];
|
||||||
|
bluCache[1] = blumap[1 + x][0 + y];
|
||||||
|
bluCache[2] = blumap[1 + x][1 + y];
|
||||||
|
bluCache[3] = blumap[0 + x][1 + y];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This works around a bug in CLC atm
|
||||||
|
*/
|
||||||
|
private int avg(int... lightVals) {
|
||||||
|
blockLightBitChannel = 0;
|
||||||
|
redBitChannel = 0;
|
||||||
|
greenBitChannel = 0;
|
||||||
|
blueBitChannel = 0;
|
||||||
|
sunlightBitChannel = 0;
|
||||||
|
|
||||||
|
for (int light : lightVals) {
|
||||||
|
blockLightBitChannel += (light & 0xFF);
|
||||||
|
redBitChannel += (light & 0xF00);
|
||||||
|
greenBitChannel += (light & 0xF000);
|
||||||
|
blueBitChannel += (light & 0xF0000);
|
||||||
|
sunlightBitChannel += (light & 0xF00000);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((blockLightBitChannel / lightVals.length) & 0xFF) | ((redBitChannel / lightVals.length) & 0xF00)
|
||||||
|
| ((greenBitChannel / lightVals.length) & 0xF000)
|
||||||
|
| ((blueBitChannel / lightVals.length) & 0xF0000)
|
||||||
|
| ((sunlightBitChannel / lightVals.length) & 0xF00000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return where the point lies between the render bounds along the axis, from 0 at their min to 1 at their max
|
||||||
|
*/
|
||||||
|
protected double boundsFraction(int axis, double x, double y, double z) {
|
||||||
|
double min = axis == 0 ? renderMinX : axis == 1 ? renderMinY : renderMinZ;
|
||||||
|
double max = axis == 0 ? renderMaxX : axis == 1 ? renderMaxY : renderMaxZ;
|
||||||
|
double pos = axis == 0 ? x : axis == 1 ? y : z;
|
||||||
|
return max > min ? (pos - min) / (max - min) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the color and brightness at a point of the face, mixed from the corners of the light maps, which are the
|
||||||
|
* corners of the render bounds. The point is given in the maps' x and y, from 0 to 1.
|
||||||
|
*/
|
||||||
|
protected void mixLight(double x, double y) {
|
||||||
|
double w00 = (1 - x) * (1 - y);
|
||||||
|
double w20 = x * (1 - y);
|
||||||
|
double w22 = x * y;
|
||||||
|
double w02 = (1 - x) * y;
|
||||||
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
tessellator.setColorOpaque_F(
|
||||||
|
mixColor(redmap, w00, w20, w22, w02),
|
||||||
|
mixColor(grnmap, w00, w20, w22, w02),
|
||||||
|
mixColor(blumap, w00, w20, w22, w02));
|
||||||
|
// vanilla mixes the corners of partial bounds the same way
|
||||||
|
tessellator.setBrightness(
|
||||||
|
mixAoBrightness(lightmap[0][0], lightmap[2][0], lightmap[2][2], lightmap[0][2], w00, w20, w22, w02));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float mixColor(float[][] map, double w00, double w20, double w22, double w02) {
|
||||||
|
return (float) (map[0][0] * w00 + map[2][0] * w20 + map[2][2] * w22 + map[0][2] * w02);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void side(Block block, SubSide side, int iconIndex) {
|
||||||
|
|
||||||
|
// If we have an overridden texture when we're supposed to render a CTM texture,
|
||||||
|
// we'll treat it as a normal block texture but still render it the CTM way: quarter of a texture at a time.
|
||||||
|
// This way has one benefit: if an overridden texture is a base block texture and a CTM texture (that is being
|
||||||
|
// rendered next) is an overlay texture above the base, we're avoiding any z-fighting issues because we
|
||||||
|
// create identical vertices and now only order of rendering dictates which texture will be rendered above
|
||||||
|
if (hasOverrideBlockTexture()) {
|
||||||
|
IIcon icon = overrideBlockTexture;
|
||||||
|
|
||||||
|
double u0 = icon.getMinU();
|
||||||
|
double u1 = icon.getMaxU();
|
||||||
|
double v0 = icon.getMinV();
|
||||||
|
double v1 = icon.getMaxV();
|
||||||
|
|
||||||
|
double uMid = (u0 + u1) / 2;
|
||||||
|
double vMid = (v0 + v1) / 2;
|
||||||
|
|
||||||
|
// Map all LB-style subsides to bottom-left quarter, RB to bottom-right, RT to top-right, LT to top-left
|
||||||
|
switch (side) {
|
||||||
|
// bottom-left quarter
|
||||||
|
case XNEG_LB, XPOS_LB, YNEG_LB, YPOS_LB, ZNEG_LB, ZPOS_LB -> {
|
||||||
|
minU = u0;
|
||||||
|
maxU = uMid;
|
||||||
|
minV = vMid;
|
||||||
|
maxV = v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// bottom-right quarter
|
||||||
|
case XNEG_RB, XPOS_RB, YNEG_RB, YPOS_RB, ZNEG_RB, ZPOS_RB -> {
|
||||||
|
minU = uMid;
|
||||||
|
maxU = u1;
|
||||||
|
minV = vMid;
|
||||||
|
maxV = v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// top-right quarter
|
||||||
|
case XNEG_RT, XPOS_RT, YNEG_RT, YPOS_RT, ZNEG_RT, ZPOS_RT -> {
|
||||||
|
minU = uMid;
|
||||||
|
maxU = u1;
|
||||||
|
minV = v0;
|
||||||
|
maxV = vMid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// top-left quarter
|
||||||
|
case XNEG_LT, XPOS_LT, YNEG_LT, YPOS_LT, ZNEG_LT, ZPOS_LT -> {
|
||||||
|
minU = u0;
|
||||||
|
maxU = uMid;
|
||||||
|
minV = v0;
|
||||||
|
maxV = vMid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
side.render(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IIcon icon;
|
||||||
|
TextureSubmap map;
|
||||||
|
if (iconIndex >= 16) {
|
||||||
|
iconIndex -= 16;
|
||||||
|
map = submapSmall;
|
||||||
|
} else {
|
||||||
|
map = submap;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (map == null) {
|
||||||
|
icon = getBlockIconFromSideAndMetadata(block, side.normal.ordinal(), meta);
|
||||||
|
} else {
|
||||||
|
int x = iconIndex % map.getWidth();
|
||||||
|
int y = iconIndex / map.getHeight();
|
||||||
|
icon = map.getSubIcon(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
minU = icon.getMinU();
|
||||||
|
maxU = icon.getMaxU();
|
||||||
|
minV = icon.getMinV();
|
||||||
|
maxV = icon.getMaxV();
|
||||||
|
|
||||||
|
side.render(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
pre(ForgeDirection.WEST);
|
||||||
|
if (!inWorld || submap == null) {
|
||||||
|
super.renderFaceXNeg(block, 0, 0, 0, icon);
|
||||||
|
} else {
|
||||||
|
int[] tex = ctm.getSubmapIndices(blockAccess, bx, by, bz, 4);
|
||||||
|
|
||||||
|
fillLightmap(brightnessBottomRight, brightnessTopRight, brightnessTopLeft, brightnessBottomLeft);
|
||||||
|
fillColormap(colorRedBottomRight, colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, redmap);
|
||||||
|
fillColormap(colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, grnmap);
|
||||||
|
fillColormap(colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, blumap);
|
||||||
|
|
||||||
|
getLight(0, 0);
|
||||||
|
side(block, XNEG_LB, tex[0]);
|
||||||
|
getLight(1, 0);
|
||||||
|
side(block, XNEG_RB, tex[1]);
|
||||||
|
getLight(1, 1);
|
||||||
|
side(block, XNEG_RT, tex[2]);
|
||||||
|
getLight(0, 1);
|
||||||
|
side(block, XNEG_LT, tex[3]);
|
||||||
|
}
|
||||||
|
post(ForgeDirection.WEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
pre(ForgeDirection.EAST);
|
||||||
|
if (!inWorld || submap == null) {
|
||||||
|
super.renderFaceXPos(block, 0, 0, 0, icon);
|
||||||
|
} else {
|
||||||
|
int[] tex = ctm.getSubmapIndices(blockAccess, bx, by, bz, 5);
|
||||||
|
|
||||||
|
fillLightmap(brightnessTopLeft, brightnessBottomLeft, brightnessBottomRight, brightnessTopRight);
|
||||||
|
fillColormap(colorRedTopLeft, colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, redmap);
|
||||||
|
fillColormap(colorGreenTopLeft, colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, grnmap);
|
||||||
|
fillColormap(colorBlueTopLeft, colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, blumap);
|
||||||
|
|
||||||
|
getLight(0, 0);
|
||||||
|
side(block, XPOS_LB, tex[0]);
|
||||||
|
getLight(1, 0);
|
||||||
|
side(block, XPOS_RB, tex[1]);
|
||||||
|
getLight(1, 1);
|
||||||
|
side(block, XPOS_RT, tex[2]);
|
||||||
|
getLight(0, 1);
|
||||||
|
side(block, XPOS_LT, tex[3]);
|
||||||
|
}
|
||||||
|
post(ForgeDirection.EAST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
pre(ForgeDirection.NORTH);
|
||||||
|
if (!inWorld || submap == null) {
|
||||||
|
super.renderFaceZNeg(block, 0, 0, 0, icon);
|
||||||
|
} else {
|
||||||
|
int[] tex = ctm.getSubmapIndices(blockAccess, bx, by, bz, 2);
|
||||||
|
|
||||||
|
fillLightmap(brightnessBottomRight, brightnessTopRight, brightnessTopLeft, brightnessBottomLeft);
|
||||||
|
fillColormap(colorRedBottomRight, colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, redmap);
|
||||||
|
fillColormap(colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, grnmap);
|
||||||
|
fillColormap(colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, blumap);
|
||||||
|
|
||||||
|
getLight(0, 0);
|
||||||
|
side(block, ZNEG_LB, tex[0]);
|
||||||
|
getLight(1, 0);
|
||||||
|
side(block, ZNEG_RB, tex[1]);
|
||||||
|
getLight(1, 1);
|
||||||
|
side(block, ZNEG_RT, tex[2]);
|
||||||
|
getLight(0, 1);
|
||||||
|
side(block, ZNEG_LT, tex[3]);
|
||||||
|
}
|
||||||
|
post(ForgeDirection.NORTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
pre(ForgeDirection.SOUTH);
|
||||||
|
if (!inWorld || submap == null) {
|
||||||
|
super.renderFaceZPos(block, 0, 0, 0, icon);
|
||||||
|
} else {
|
||||||
|
int[] tex = ctm.getSubmapIndices(blockAccess, bx, by, bz, 3);
|
||||||
|
|
||||||
|
fillLightmap(brightnessBottomLeft, brightnessBottomRight, brightnessTopRight, brightnessTopLeft);
|
||||||
|
fillColormap(colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, colorRedTopLeft, redmap);
|
||||||
|
fillColormap(colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, grnmap);
|
||||||
|
fillColormap(colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, blumap);
|
||||||
|
|
||||||
|
getLight(0, 0);
|
||||||
|
side(block, ZPOS_LB, tex[0]);
|
||||||
|
getLight(1, 0);
|
||||||
|
side(block, ZPOS_RB, tex[1]);
|
||||||
|
getLight(1, 1);
|
||||||
|
side(block, ZPOS_RT, tex[2]);
|
||||||
|
getLight(0, 1);
|
||||||
|
side(block, ZPOS_LT, tex[3]);
|
||||||
|
}
|
||||||
|
post(ForgeDirection.SOUTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
pre(ForgeDirection.DOWN);
|
||||||
|
if (!inWorld || submap == null) {
|
||||||
|
super.renderFaceYNeg(block, 0, 0, 0, icon);
|
||||||
|
} else {
|
||||||
|
int[] tex = ctm.getSubmapIndices(blockAccess, bx, by, bz, 0);
|
||||||
|
|
||||||
|
fillLightmap(brightnessBottomLeft, brightnessBottomRight, brightnessTopRight, brightnessTopLeft);
|
||||||
|
fillColormap(colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, colorRedTopLeft, redmap);
|
||||||
|
fillColormap(colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, grnmap);
|
||||||
|
fillColormap(colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, blumap);
|
||||||
|
|
||||||
|
getLight(0, 0);
|
||||||
|
side(block, YNEG_LB, tex[0]);
|
||||||
|
getLight(1, 0);
|
||||||
|
side(block, YNEG_RB, tex[1]);
|
||||||
|
getLight(1, 1);
|
||||||
|
side(block, YNEG_RT, tex[2]);
|
||||||
|
getLight(0, 1);
|
||||||
|
side(block, YNEG_LT, tex[3]);
|
||||||
|
}
|
||||||
|
post(ForgeDirection.DOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
pre(ForgeDirection.UP);
|
||||||
|
if (!inWorld || submap == null) {
|
||||||
|
super.renderFaceYPos(block, 0, 0, 0, icon);
|
||||||
|
} else {
|
||||||
|
int[] tex = ctm.getSubmapIndices(blockAccess, bx, by, bz, 1);
|
||||||
|
|
||||||
|
fillLightmap(brightnessTopRight, brightnessTopLeft, brightnessBottomLeft, brightnessBottomRight);
|
||||||
|
fillColormap(colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, colorRedBottomRight, redmap);
|
||||||
|
fillColormap(colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, colorGreenBottomRight, grnmap);
|
||||||
|
fillColormap(colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, colorBlueBottomRight, blumap);
|
||||||
|
|
||||||
|
getLight(0, 0);
|
||||||
|
side(block, YPOS_LB, tex[0]);
|
||||||
|
getLight(1, 0);
|
||||||
|
side(block, YPOS_RB, tex[1]);
|
||||||
|
getLight(1, 1);
|
||||||
|
side(block, YPOS_RT, tex[2]);
|
||||||
|
getLight(0, 1);
|
||||||
|
side(block, YPOS_LT, tex[3]);
|
||||||
|
}
|
||||||
|
post(ForgeDirection.UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void pre(ForgeDirection face) {
|
||||||
|
manager.preRenderSide(this, blockAccess, bx, by, bz, face);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void post(ForgeDirection face) {
|
||||||
|
manager.postRenderSide(this, blockAccess, bx, by, bz, face);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used by {@link TextureType#CTMV}
|
||||||
|
*/
|
||||||
|
public class RenderBlocksColumn extends RenderBlocks {
|
||||||
|
|
||||||
|
public TextureSubmap submap;
|
||||||
|
public IIcon iconTop;
|
||||||
|
private boolean inWorld;
|
||||||
|
|
||||||
|
private final IIcon[] sides = new IIcon[6];
|
||||||
|
private final CTM ctm = CTM.getInstance();
|
||||||
|
|
||||||
|
public RenderBlocksColumn() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean connected(IBlockAccess world, int x, int y, int z, int fromX, int fromY, int fromZ, Block block, int meta) {
|
||||||
|
return ctm.matches(world, x, y, z, -1, fromX, fromY, fromZ, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderStandardBlock(Block block, int x, int y, int z) {
|
||||||
|
int metadata = blockAccess.getBlockMetadata(x, y, z);
|
||||||
|
inWorld = true;
|
||||||
|
|
||||||
|
boolean yp = connected(blockAccess, x, y + 1, z, x, y, z, block, metadata);
|
||||||
|
boolean yn = connected(blockAccess, x, y - 1, z, x, y, z, block, metadata);
|
||||||
|
|
||||||
|
if (yp || yn) {
|
||||||
|
sides[0] = iconTop;
|
||||||
|
sides[1] = iconTop;
|
||||||
|
|
||||||
|
if (yp && yn) sides[2] = submap.getSubIcon(0, 1);
|
||||||
|
else if (yp) sides[2] = submap.getSubIcon(1, 1);
|
||||||
|
else sides[2] = submap.getSubIcon(1, 0);
|
||||||
|
|
||||||
|
sides[3] = sides[4] = sides[5] = sides[2];
|
||||||
|
} else {
|
||||||
|
boolean xp = connected(blockAccess, x + 1, y, z, x, y, z, block, metadata);
|
||||||
|
boolean xn = connected(blockAccess, x - 1, y, z, x, y, z, block, metadata);
|
||||||
|
|
||||||
|
if (xp && (connected(blockAccess, x + 1, y + 1, z, x + 1, y, z, block, metadata)
|
||||||
|
|| connected(blockAccess, x + 1, y - 1, z, x + 1, y, z, block, metadata))) xp = false;
|
||||||
|
if (xn && (connected(blockAccess, x - 1, y + 1, z, x - 1, y, z, block, metadata)
|
||||||
|
|| connected(blockAccess, x - 1, y - 1, z, x - 1, y, z, block, metadata))) xn = false;
|
||||||
|
|
||||||
|
if (xp || xn) {
|
||||||
|
uvRotateEast = 2;
|
||||||
|
uvRotateWest = 1;
|
||||||
|
uvRotateTop = 1;
|
||||||
|
uvRotateBottom = 1;
|
||||||
|
|
||||||
|
sides[4] = iconTop;
|
||||||
|
sides[5] = iconTop;
|
||||||
|
|
||||||
|
// for some reason along the x axis the bottom texture on the ends is backwards. This flips it around.
|
||||||
|
if (xp && xn) {
|
||||||
|
sides[1] = submap.getSubIcon(0, 1);
|
||||||
|
sides[0] = sides[1];
|
||||||
|
} else if (xp) {
|
||||||
|
sides[1] = submap.getSubIcon(1, 1);
|
||||||
|
sides[0] = submap.getSubIcon(1, 0);
|
||||||
|
} else {
|
||||||
|
sides[1] = submap.getSubIcon(1, 0);
|
||||||
|
sides[0] = submap.getSubIcon(1, 1);
|
||||||
|
}
|
||||||
|
sides[2] = sides[3] = sides[1];
|
||||||
|
} else {
|
||||||
|
boolean zp = connected(blockAccess, x, y, z + 1, x, y, z, block, metadata);
|
||||||
|
boolean zn = connected(blockAccess, x, y, z - 1, x, y, z, block, metadata);
|
||||||
|
|
||||||
|
if (zp && (connected(blockAccess, x, y + 1, z + 1, x, y, z + 1, block, metadata)
|
||||||
|
|| connected(blockAccess, x, y - 1, z + 1, x, y, z + 1, block, metadata))) zp = false;
|
||||||
|
if (zp && (connected(blockAccess, x + 1, y, z + 1, x, y, z + 1, block, metadata)
|
||||||
|
|| connected(blockAccess, x - 1, y, z + 1, x, y, z + 1, block, metadata))) zp = false;
|
||||||
|
if (zn && (connected(blockAccess, x, y + 1, z - 1, x, y, z - 1, block, metadata)
|
||||||
|
|| connected(blockAccess, x, y - 1, z - 1, x, y, z - 1, block, metadata))) zn = false;
|
||||||
|
if (zn && (connected(blockAccess, x + 1, y, z - 1, x, y, z - 1, block, metadata)
|
||||||
|
|| connected(blockAccess, x - 1, y, z - 1, x, y, z - 1, block, metadata))) zn = false;
|
||||||
|
|
||||||
|
if (zp || zn) {
|
||||||
|
uvRotateSouth = 1;
|
||||||
|
uvRotateNorth = 2;
|
||||||
|
|
||||||
|
sides[2] = iconTop;
|
||||||
|
sides[3] = iconTop;
|
||||||
|
|
||||||
|
if (zp && zn) sides[0] = submap.getSubIcon(0, 1);
|
||||||
|
else if (zp) sides[0] = submap.getSubIcon(1, 0);
|
||||||
|
else sides[0] = submap.getSubIcon(1, 1);
|
||||||
|
|
||||||
|
sides[1] = sides[4] = sides[5] = sides[0];
|
||||||
|
} else {
|
||||||
|
sides[0] = sides[1] = iconTop;
|
||||||
|
sides[2] = sides[3] = sides[4] = sides[5] = submap.getSubIcon(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean flag = super.renderStandardBlock(block, x, y, z);
|
||||||
|
|
||||||
|
uvRotateSouth = 0;
|
||||||
|
uvRotateEast = 0;
|
||||||
|
uvRotateWest = 0;
|
||||||
|
uvRotateNorth = 0;
|
||||||
|
uvRotateTop = 0;
|
||||||
|
uvRotateBottom = 0;
|
||||||
|
|
||||||
|
inWorld = false;
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
super.renderFaceXNeg(block, x, y, z, getIcon(icon, 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
super.renderFaceXPos(block, x, y, z, getIcon(icon, 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
super.renderFaceZNeg(block, x, y, z, getIcon(icon, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
super.renderFaceZPos(block, x, y, z, getIcon(icon, 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
super.renderFaceYNeg(block, x, y, z, getIcon(icon, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) {
|
||||||
|
super.renderFaceYPos(block, x, y, z, getIcon(icon, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private IIcon getIcon(IIcon defaultIcon, int side) {
|
||||||
|
return sides[side] == null || !inWorld ? defaultIcon : sides[side];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A convenience implementation of {@link ISubmapManager} which does the standard CTM behavior.
|
||||||
|
*/
|
||||||
|
public class SubmapManagerCTM implements ISubmapManager {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private static final ThreadLocal<RenderBlocksCTM> renderBlocksThreadLocal = ThreadLocal
|
||||||
|
.withInitial(RenderBlocksCTM::new);
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private TextureSubmap submap, submapSmall;
|
||||||
|
@Getter
|
||||||
|
private final String textureName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param textureName The path to the texture, excluding the mod ID (this is passed into
|
||||||
|
* {@link #registerIcons(String, Block, IIconRegister)}).
|
||||||
|
* <p>
|
||||||
|
* The CTM texture will be this path, plus {@code "-ctm"}.
|
||||||
|
*/
|
||||||
|
public SubmapManagerCTM(String textureName) {
|
||||||
|
this.textureName = textureName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
return submapSmall.getBaseIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
return getIcon(side, world.getBlockMetadata(x, y, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||||
|
submap = new TextureSubmap(register.registerIcon(modName + ":" + textureName + "-ctm"), 4, 4);
|
||||||
|
submapSmall = new TextureSubmap(register.registerIcon(modName + ":" + textureName), 2, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||||
|
RenderBlocksCTM rb = renderBlocksThreadLocal.get();
|
||||||
|
rb.setRenderBoundsFromBlock(block);
|
||||||
|
rb.submap = submap;
|
||||||
|
rb.submapSmall = submapSmall;
|
||||||
|
return rb;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
package team.chisel.ctmlib;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import lombok.experimental.Delegate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is used to split up a large IIcon into smaller "submapped" icons used for CTM and other texture
|
||||||
|
* manipulation.
|
||||||
|
*/
|
||||||
|
public class TextureSubmap implements IIcon, ISubmap {
|
||||||
|
|
||||||
|
private static List<TextureSubmap> submaps = Lists.newArrayList();
|
||||||
|
private static TextureSubmap dummy = new TextureSubmap(null, 0, 0);
|
||||||
|
static {
|
||||||
|
MinecraftForge.EVENT_BUS.register(dummy);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int width, height;
|
||||||
|
@Delegate
|
||||||
|
private IIcon baseIcon;
|
||||||
|
|
||||||
|
protected IIcon[][] icons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new submap. A submap is not required to be square, but it is required to be rectangular.
|
||||||
|
*
|
||||||
|
* @param baseIcon The IIcon to submap.
|
||||||
|
* @param width The width of the map, in icons.
|
||||||
|
* @param height The height of the map, in icons.
|
||||||
|
*/
|
||||||
|
public TextureSubmap(IIcon baseIcon, int width, int height) {
|
||||||
|
this.baseIcon = baseIcon;
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
|
this.icons = new IIcon[width][height];
|
||||||
|
submaps.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The large "base" icon used for the submap.
|
||||||
|
*/
|
||||||
|
public IIcon getBaseIcon() {
|
||||||
|
return baseIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all the icons in this submap. This is an expensive operation as it first clones the entire 2D array.
|
||||||
|
*
|
||||||
|
* @return All icons in this submap.
|
||||||
|
*/
|
||||||
|
public IIcon[][] getAllIcons() {
|
||||||
|
IIcon[][] ret = ArrayUtils.clone(icons);
|
||||||
|
for (int i = 0; i < ret.length; i++) {
|
||||||
|
ret[i] = ArrayUtils.clone(ret[i]);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==== ISubmap ==== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds and returns the sub-icon at the given coordinates. For example, if you have a 3 by 3 submap, calling
|
||||||
|
* {@code getSubIcon(1, 1)} will return the center subicon.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IIcon getSubIcon(int x, int y) {
|
||||||
|
x = x % icons.length;
|
||||||
|
return icons[x][y % icons[x].length];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==== Internal Stitching Logic ==== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For internal use only, this is used to create the virtual "subicons" used in the map.
|
||||||
|
*/
|
||||||
|
@SubscribeEvent
|
||||||
|
public final void TexturesStitched(TextureStitchEvent.Post event) {
|
||||||
|
for (TextureSubmap ts : submaps) {
|
||||||
|
ts.texturesStitched();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void texturesStitched() {
|
||||||
|
for (int x = 0; x < width; x++) {
|
||||||
|
for (int y = 0; y < height; y++) {
|
||||||
|
icons[x][y] = new TextureVirtual(getBaseIcon(), width, height, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TextureVirtual implements IIcon {
|
||||||
|
|
||||||
|
private int width, height;
|
||||||
|
private float umin, umax, vmin, vmax;
|
||||||
|
private IIcon parentIcon;
|
||||||
|
|
||||||
|
private TextureVirtual(IIcon parent, int w, int h, int x, int y) {
|
||||||
|
parentIcon = parent;
|
||||||
|
|
||||||
|
umin = parentIcon.getInterpolatedU(16.0 * (x) / w);
|
||||||
|
umax = parentIcon.getInterpolatedU(16.0 * (x + 1) / w);
|
||||||
|
vmin = parentIcon.getInterpolatedV(16.0 * (y) / h);
|
||||||
|
vmax = parentIcon.getInterpolatedV(16.0 * (y + 1) / h);
|
||||||
|
|
||||||
|
width = parentIcon.getIconWidth();
|
||||||
|
height = parentIcon.getIconHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getMinU() {
|
||||||
|
return umin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getMaxU() {
|
||||||
|
return umax;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getInterpolatedU(double d0) {
|
||||||
|
return (float) (umin + (umax - umin) * d0 / 16.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getMinV() {
|
||||||
|
return vmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getMaxV() {
|
||||||
|
return vmax;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getInterpolatedV(double d0) {
|
||||||
|
return (float) (vmin + (vmax - vmin) * d0 / 16.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getIconName() {
|
||||||
|
return parentIcon.getIconName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getIconWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getIconHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,36 @@ import net.minecraft.block.Block;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||||
import team.chisel.Chisel;
|
import team.chisel.Chisel;
|
||||||
import team.chisel.block.*;
|
import team.chisel.block.BlockCarvable;
|
||||||
|
import team.chisel.block.BlockCarvableBeacon;
|
||||||
|
import team.chisel.block.BlockCarvableCarpet;
|
||||||
|
import team.chisel.block.BlockCarvableConcreteSlab;
|
||||||
|
import team.chisel.block.BlockCarvableConcreteStairs;
|
||||||
|
import team.chisel.block.BlockCarvableGlass;
|
||||||
|
import team.chisel.block.BlockCarvableGlowstone;
|
||||||
|
import team.chisel.block.BlockCarvableIce;
|
||||||
|
import team.chisel.block.BlockCarvableIceStairs;
|
||||||
|
import team.chisel.block.BlockCarvableLayered;
|
||||||
|
import team.chisel.block.BlockCarvablePackedIce;
|
||||||
|
import team.chisel.block.BlockCarvablePackedIceStairs;
|
||||||
|
import team.chisel.block.BlockCarvablePane;
|
||||||
|
import team.chisel.block.BlockCarvablePowered;
|
||||||
|
import team.chisel.block.BlockCarvablePumpkin;
|
||||||
|
import team.chisel.block.BlockCarvableSand;
|
||||||
|
import team.chisel.block.BlockCarvableSlab;
|
||||||
|
import team.chisel.block.BlockCarvableStairs;
|
||||||
|
import team.chisel.block.BlockCarvableTorch;
|
||||||
|
import team.chisel.block.BlockCarvableWall;
|
||||||
|
import team.chisel.block.BlockCloud;
|
||||||
|
import team.chisel.block.BlockConcrete;
|
||||||
|
import team.chisel.block.BlockGrimstone;
|
||||||
|
import team.chisel.block.BlockHolystone;
|
||||||
|
import team.chisel.block.BlockLavastone;
|
||||||
|
import team.chisel.block.BlockPresent;
|
||||||
|
import team.chisel.block.BlockRoadLine;
|
||||||
|
import team.chisel.block.BlockSnakestone;
|
||||||
|
import team.chisel.block.BlockSnakestoneObsidian;
|
||||||
|
import team.chisel.block.BlockWaterstone;
|
||||||
|
|
||||||
@ObjectHolder(Chisel.MOD_ID)
|
@ObjectHolder(Chisel.MOD_ID)
|
||||||
public final class ChiselBlocks {
|
public final class ChiselBlocks {
|
||||||
@@ -26,6 +55,7 @@ public final class ChiselBlocks {
|
|||||||
public static final BlockCarvable sandstone = null;
|
public static final BlockCarvable sandstone = null;
|
||||||
public static final BlockCarvable sandstone_scribbles = null;
|
public static final BlockCarvable sandstone_scribbles = null;
|
||||||
public static final BlockConcrete concrete = null;
|
public static final BlockConcrete concrete = null;
|
||||||
|
public static final BlockCarvableConcreteSlab concrete_slab = null;
|
||||||
public static final BlockRoadLine road_line = null;
|
public static final BlockRoadLine road_line = null;
|
||||||
public static final BlockCarvable iron_block = null;
|
public static final BlockCarvable iron_block = null;
|
||||||
public static final BlockCarvable gold_block = null;
|
public static final BlockCarvable gold_block = null;
|
||||||
@@ -38,6 +68,7 @@ public final class ChiselBlocks {
|
|||||||
public static final BlockCarvable netherrack = null;
|
public static final BlockCarvable netherrack = null;
|
||||||
public static final BlockCarvable mossy_cobblestone = null;
|
public static final BlockCarvable mossy_cobblestone = null;
|
||||||
public static final BlockCarvable stonebricksmooth = null;
|
public static final BlockCarvable stonebricksmooth = null;
|
||||||
|
public static final BlockCarvable hardenedClay = null;
|
||||||
public static final BlockCarvablePane iron_bars = null;
|
public static final BlockCarvablePane iron_bars = null;
|
||||||
public static final BlockCarvableIce ice = null;
|
public static final BlockCarvableIce ice = null;
|
||||||
public static final BlockCarvableIce ice_pillar = null;
|
public static final BlockCarvableIce ice_pillar = null;
|
||||||
@@ -119,10 +150,13 @@ public final class ChiselBlocks {
|
|||||||
public static BlockCarvableStairs[] limestoneStairs = new BlockCarvableStairs[8];
|
public static BlockCarvableStairs[] limestoneStairs = new BlockCarvableStairs[8];
|
||||||
public static BlockCarvableIceStairs[] iceStairs = new BlockCarvableIceStairs[8];
|
public static BlockCarvableIceStairs[] iceStairs = new BlockCarvableIceStairs[8];
|
||||||
public static BlockCarvablePackedIceStairs[] packediceStairs = new BlockCarvablePackedIceStairs[8];
|
public static BlockCarvablePackedIceStairs[] packediceStairs = new BlockCarvablePackedIceStairs[8];
|
||||||
|
public static BlockCarvableConcreteStairs[] concreteStairs = new BlockCarvableConcreteStairs[6];
|
||||||
|
|
||||||
public static Block[] torches = new BlockCarvableTorch[16];
|
public static Block[] torches = new BlockCarvableTorch[16];
|
||||||
|
|
||||||
public static BlockCarvable[] planks = new BlockCarvable[6];
|
public static BlockCarvable[] planks = new BlockCarvable[6];
|
||||||
|
public static BlockCarvable[] planks_bop = new BlockCarvable[14];
|
||||||
|
public static BlockCarvable[] planks_tc = new BlockCarvable[2];
|
||||||
|
|
||||||
public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16];
|
public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16];
|
||||||
public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16];
|
public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16];
|
||||||
@@ -140,5 +174,41 @@ public final class ChiselBlocks {
|
|||||||
// 1.9... drull pls
|
// 1.9... drull pls
|
||||||
public static final BlockCarvable purpur = null;
|
public static final BlockCarvable purpur = null;
|
||||||
|
|
||||||
|
// 1.19, skipped 10 versions but thats fine
|
||||||
|
public static final BlockCarvable froglight = null;
|
||||||
|
|
||||||
|
// Backports from Dustrial Decor. Original artists are WDSPC and Evo_94!
|
||||||
|
public static final BlockCarvable lantern = null;
|
||||||
|
public static final BlockCarvable sheetmetal = null;
|
||||||
|
|
||||||
|
// June Additions
|
||||||
|
public static final BlockCarvable moss = null;
|
||||||
|
public static final BlockCarvableCarpet moss_carpet = null;
|
||||||
|
public static final BlockCarvable cobalt = null;
|
||||||
|
public static final BlockCarvable electrum = null;
|
||||||
|
public static final BlockCarvable invar = null;
|
||||||
|
public static final BlockCarvable nickel = null;
|
||||||
|
public static final BlockCarvable platinum = null;
|
||||||
|
public static final BlockCarvable cast_iron = null;
|
||||||
|
public static final BlockCarvable stainless_steel = null;
|
||||||
|
public static final BlockCarvable titanium = null;
|
||||||
|
public static final BlockCarvable tungstensteel = null;
|
||||||
|
public static final BlockCarvable rpp = null;
|
||||||
|
public static final BlockCarvable iridium = null;
|
||||||
|
public static final BlockCarvable osmium = null;
|
||||||
|
public static final BlockCarvable coral = null;
|
||||||
|
public static final BlockCarvable coral2 = null;
|
||||||
|
public static final BlockCarvable mud = null;
|
||||||
|
public static final BlockCarvable albumblock = null;
|
||||||
|
public static final BlockCarvable albumblock2 = null;
|
||||||
|
public static final BlockCarvable albumblock3 = null;
|
||||||
|
public static final BlockCarvable brickCustom2 = null;
|
||||||
|
public static final BlockCarvable brutalism = null;
|
||||||
|
public static final BlockConcrete road = null;
|
||||||
|
public static final BlockCarvable porcelain = null;
|
||||||
|
public static final BlockCarvable alabaster = null;
|
||||||
|
|
||||||
|
// Architect's Palette Backport
|
||||||
|
|
||||||
private ChiselBlocks() {}
|
private ChiselBlocks() {}
|
||||||
}
|
}
|
||||||
@@ -96,6 +96,7 @@ public class ContainerChisel extends Container {
|
|||||||
itemstack = itemstack1.copy();
|
itemstack = itemstack1.copy();
|
||||||
|
|
||||||
if (slotIdx > InventoryChiselSelection.normalSlots) {
|
if (slotIdx > InventoryChiselSelection.normalSlots) {
|
||||||
|
// clicked in player inventory
|
||||||
if (!this.mergeItemStack(
|
if (!this.mergeItemStack(
|
||||||
itemstack1,
|
itemstack1,
|
||||||
InventoryChiselSelection.normalSlots,
|
InventoryChiselSelection.normalSlots,
|
||||||
@@ -104,10 +105,13 @@ public class ContainerChisel extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
entity.inventory.setItemStack(itemstack1.copy());
|
// only run this logic if a chisel selection slot was clicked (i.e. not the input slot)
|
||||||
slot.onPickupFromSlot(entity, itemstack1);
|
if (slotIdx != InventoryChiselSelection.normalSlots) {
|
||||||
itemstack1 = entity.inventory.getItemStack();
|
entity.inventory.setItemStack(itemstack1.copy());
|
||||||
entity.inventory.setItemStack(null);
|
slot.onPickupFromSlot(entity, itemstack1);
|
||||||
|
itemstack1 = entity.inventory.getItemStack();
|
||||||
|
entity.inventory.setItemStack(null);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.mergeItemStack(
|
if (!this.mergeItemStack(
|
||||||
itemstack1,
|
itemstack1,
|
||||||
@@ -115,6 +119,10 @@ public class ContainerChisel extends Container {
|
|||||||
InventoryChiselSelection.normalSlots + 1 + 36,
|
InventoryChiselSelection.normalSlots + 1 + 36,
|
||||||
false)) {
|
false)) {
|
||||||
entity.inventory.setItemStack(itemstack1);
|
entity.inventory.setItemStack(itemstack1);
|
||||||
|
if (slotIdx == InventoryChiselSelection.normalSlots) {
|
||||||
|
slot.onPickupFromSlot(entity, itemstack1);
|
||||||
|
slot.putStack(null);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,13 +160,13 @@ public class ContainerChisel extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onChiselSlotChanged() {
|
public void onChiselSlotChanged() {
|
||||||
ItemStack stack = playerInventory.mainInventory[chiselSlot];
|
ItemStack stack = playerInventory.getStackInSlot(chiselSlot);
|
||||||
if (stack == null || !stack.isItemEqual(chisel)) finished = true;
|
if (stack == null || !stack.isItemEqual(chisel)) finished = true;
|
||||||
|
|
||||||
if (finished) return;
|
if (finished) return;
|
||||||
|
|
||||||
General.setChiselTarget(chisel, inventory.getStackInSpecialSlot());
|
General.setChiselTarget(chisel, inventory.getStackInSpecialSlot());
|
||||||
|
|
||||||
playerInventory.mainInventory[chiselSlot] = chisel;
|
playerInventory.setInventorySlotContents(chiselSlot, chisel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ public class SlotChiselSelection extends Slot {
|
|||||||
.onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) {
|
.onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) {
|
||||||
container.chisel.damageItem(1, player);
|
container.chisel.damageItem(1, player);
|
||||||
if (container.chisel.stackSize <= 0) {
|
if (container.chisel.stackSize <= 0) {
|
||||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
player.setCurrentItemOrArmor(0, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ public class ItemUpgrade extends BaseItem {
|
|||||||
@Override
|
@Override
|
||||||
public IIcon getIconFromDamage(int meta) {
|
public IIcon getIconFromDamage(int meta) {
|
||||||
// using modulo throughout to prevent AIOB
|
// using modulo throughout to prevent AIOB
|
||||||
return this.icons[meta % Upgrade.values().length];
|
return this.icons[meta % Upgrade.VALUES.length];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister reg) {
|
public void registerIcons(IIconRegister reg) {
|
||||||
Upgrade[] upgrades = Upgrade.values();
|
Upgrade[] upgrades = Upgrade.VALUES;
|
||||||
for (int i = 0; i < upgrades.length; i++) {
|
for (int i = 0; i < upgrades.length; i++) {
|
||||||
this.icons[i] = reg.registerIcon(
|
this.icons[i] = reg.registerIcon(
|
||||||
Chisel.MOD_ID + ":upgrade_"
|
Chisel.MOD_ID + ":upgrade_"
|
||||||
@@ -43,14 +43,14 @@ public class ItemUpgrade extends BaseItem {
|
|||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
@Override
|
@Override
|
||||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||||
for (int i = 0; i < Upgrade.values().length; i++) {
|
for (int i = 0; i < Upgrade.VALUES.length; i++) {
|
||||||
list.add(new ItemStack(item, 1, i));
|
list.add(new ItemStack(item, 1, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack) {
|
public String getUnlocalizedName(ItemStack stack) {
|
||||||
Upgrade[] upgrades = Upgrade.values();
|
Upgrade[] upgrades = Upgrade.VALUES;
|
||||||
return upgrades[stack.getItemDamage() % upgrades.length].getUnlocalizedName();
|
return upgrades[stack.getItemDamage() % upgrades.length].getUnlocalizedName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,11 +31,10 @@ public final class ChiselController {
|
|||||||
|
|
||||||
protected static class GuiOpen implements Runnable {
|
protected static class GuiOpen implements Runnable {
|
||||||
|
|
||||||
private EntityPlayer player;
|
private final EntityPlayer player;
|
||||||
private ItemStack stack;
|
private final ItemStack stack;
|
||||||
|
|
||||||
public GuiOpen(EntityPlayer player, ItemStack stack) {
|
public GuiOpen(EntityPlayer player, ItemStack stack) {
|
||||||
super();
|
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
}
|
}
|
||||||
@@ -53,7 +52,7 @@ public final class ChiselController {
|
|||||||
|
|
||||||
public static final ChiselController INSTANCE = new ChiselController();
|
public static final ChiselController INSTANCE = new ChiselController();
|
||||||
|
|
||||||
Queue<GuiOpen> openQueue = Queues.newArrayDeque();
|
final Queue<GuiOpen> openQueue = Queues.newArrayDeque();
|
||||||
|
|
||||||
private ChiselController() {}
|
private ChiselController() {}
|
||||||
|
|
||||||
@@ -160,4 +159,5 @@ public final class ChiselController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ public enum ChiselMode implements IChiselMode {
|
|||||||
player.getCurrentEquippedItem()
|
player.getCurrentEquippedItem()
|
||||||
.damageItem(1, player);
|
.damageItem(1, player);
|
||||||
if (player.getCurrentEquippedItem().stackSize <= 0) {
|
if (player.getCurrentEquippedItem().stackSize <= 0) {
|
||||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
player.setCurrentItemOrArmor(0, null);
|
||||||
breakChisel = true;
|
breakChisel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import net.minecraft.init.Items;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
|
|
||||||
import com.cricketcraft.chisel.api.IChiselItem;
|
import com.cricketcraft.chisel.api.IChiselItem;
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||||
@@ -52,6 +51,7 @@ public class ItemChisel extends Item implements IChiselItem {
|
|||||||
super();
|
super();
|
||||||
this.type = type;
|
this.type = type;
|
||||||
setMaxStackSize(1);
|
setMaxStackSize(1);
|
||||||
|
setMaxDamage(Configurations.allowChiselDamage ? type.maxDamage : 0);
|
||||||
setTextureName(
|
setTextureName(
|
||||||
Chisel.MOD_ID + ":chisel_"
|
Chisel.MOD_ID + ":chisel_"
|
||||||
+ type.name()
|
+ type.name()
|
||||||
@@ -68,13 +68,6 @@ public class ItemChisel extends Item implements IChiselItem {
|
|||||||
+ type.name()
|
+ type.name()
|
||||||
.toLowerCase());
|
.toLowerCase());
|
||||||
}
|
}
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxDamage(ItemStack stack) {
|
|
||||||
if (Configurations.allowChiselDamage) return type.maxDamage;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,3 +5,7 @@ public net.minecraft.client.renderer.Tessellator field_78417_x
|
|||||||
|
|
||||||
# GUI stuff for item scale
|
# GUI stuff for item scale
|
||||||
protected net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet/minecraft/inventory/Slot;)V # drawSlot
|
protected net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet/minecraft/inventory/Slot;)V # drawSlot
|
||||||
|
|
||||||
|
# Checking if a resource exists
|
||||||
|
public net.minecraft.client.resources.SimpleReloadableResourceManager field_110548_a # domainResourceManagers
|
||||||
|
public net.minecraft.client.resources.FallbackResourceManager field_110540_a # resourcePacks
|
||||||
@@ -133,7 +133,7 @@ tile.beacon.blue.desc=Blau leuchtendes Leuchtfeuer
|
|||||||
tile.beacon.brown.desc=Braun leuchtendes Leuchtfeuer
|
tile.beacon.brown.desc=Braun leuchtendes Leuchtfeuer
|
||||||
tile.beacon.cyan.desc=Türkis leuchtendes Leuchtfeuer
|
tile.beacon.cyan.desc=Türkis leuchtendes Leuchtfeuer
|
||||||
tile.beacon.green.desc=Grün leuchtendes Leuchtfeuer
|
tile.beacon.green.desc=Grün leuchtendes Leuchtfeuer
|
||||||
tile.beacon.lightblue.desc=Hellblau leuchtendes Leuchtfeuer
|
tile.beacon.lightBlue.desc=Hellblau leuchtendes Leuchtfeuer
|
||||||
tile.beacon.silver.desc=Hellgrau leuchtendes Leuchtfeuer
|
tile.beacon.silver.desc=Hellgrau leuchtendes Leuchtfeuer
|
||||||
tile.beacon.lime.desc=Hellgrün leuchtendes Leuchtfeuer
|
tile.beacon.lime.desc=Hellgrün leuchtendes Leuchtfeuer
|
||||||
tile.beacon.magenta.desc=Lila leuchtendes Leuchtfeuer
|
tile.beacon.magenta.desc=Lila leuchtendes Leuchtfeuer
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ tile.beacon.blue.desc=Blue Beamed Beacon
|
|||||||
tile.beacon.brown.desc=Brown Beamed Beacon
|
tile.beacon.brown.desc=Brown Beamed Beacon
|
||||||
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
||||||
tile.beacon.green.desc=Green Beamed Beacon
|
tile.beacon.green.desc=Green Beamed Beacon
|
||||||
tile.beacon.lightblue.desc=Light Blue Beamed Beacon
|
tile.beacon.lightBlue.desc=Light Blue Beamed Beacon
|
||||||
# Beacon
|
# Beacon
|
||||||
tile.beacon.silver.desc=Light Grey Beamed Beacon
|
tile.beacon.silver.desc=Light Grey Beamed Beacon
|
||||||
tile.beacon.lime.desc=Lime Beamed Beacon
|
tile.beacon.lime.desc=Lime Beamed Beacon
|
||||||
@@ -238,7 +238,7 @@ tile.arcane.10.desc=Fine Thaumaturge's Emblem
|
|||||||
tile.arcane.11.desc=Cracked Rock leaking Eldritch Glow
|
tile.arcane.11.desc=Cracked Rock leaking Eldritch Glow
|
||||||
|
|
||||||
# Thaumium
|
# Thaumium
|
||||||
tile.chisel.thaumium.name=Thaumium Block
|
tile.chisel.thaumium.name=Block of Thaumium
|
||||||
tile.thaumium.0.desc=Ornate Pattern
|
tile.thaumium.0.desc=Ornate Pattern
|
||||||
tile.thaumium.1.desc=Totem Faces
|
tile.thaumium.1.desc=Totem Faces
|
||||||
tile.thaumium.2.desc=Bricks
|
tile.thaumium.2.desc=Bricks
|
||||||
@@ -692,7 +692,7 @@ tile.factory2.2.desc=Metallic Blue Circuit Plating
|
|||||||
tile.factory2.3.desc=Blue Wireframing
|
tile.factory2.3.desc=Blue Wireframing
|
||||||
|
|
||||||
# Diamond blocks
|
# Diamond blocks
|
||||||
tile.chisel.diamond_block.name=Diamond Block
|
tile.chisel.diamond_block.name=Block of Diamond
|
||||||
tile.diamond.1.desc=Embossed Diamond Block
|
tile.diamond.1.desc=Embossed Diamond Block
|
||||||
tile.diamond.2.desc=Diamond Block with Panel
|
tile.diamond.2.desc=Diamond Block with Panel
|
||||||
tile.diamond.3.desc=Diamond Cells
|
tile.diamond.3.desc=Diamond Cells
|
||||||
@@ -783,7 +783,7 @@ tile.roadLine.3.desc=Double Yellow
|
|||||||
tile.roadLine.4.desc=Hazard Tape
|
tile.roadLine.4.desc=Hazard Tape
|
||||||
|
|
||||||
# Iron Blocks
|
# Iron Blocks
|
||||||
tile.chisel.iron_block.name=Iron Block
|
tile.chisel.iron_block.name=Block of Iron
|
||||||
tile.iron.1.desc=Large Iron Ingots
|
tile.iron.1.desc=Large Iron Ingots
|
||||||
tile.iron.2.desc=Small Iron Ingots
|
tile.iron.2.desc=Small Iron Ingots
|
||||||
tile.iron.3.desc=Iron Gears
|
tile.iron.3.desc=Iron Gears
|
||||||
@@ -801,7 +801,7 @@ tile.iron.14.desc=Iron Vents
|
|||||||
tile.iron.15.desc=Simple Iron Block
|
tile.iron.15.desc=Simple Iron Block
|
||||||
|
|
||||||
# Gold Blocks
|
# Gold Blocks
|
||||||
tile.chisel.gold_block.name=Gold Block
|
tile.chisel.gold_block.name=Block of Gold
|
||||||
tile.gold.1.desc=Large Golden Ingots
|
tile.gold.1.desc=Large Golden Ingots
|
||||||
tile.gold.2.desc=Small Golden Ingots
|
tile.gold.2.desc=Small Golden Ingots
|
||||||
tile.gold.3.desc=Golden Bricks
|
tile.gold.3.desc=Golden Bricks
|
||||||
@@ -836,7 +836,7 @@ tile.lightstone.14.desc=Glowstone Bismuth
|
|||||||
tile.lightstone.15.desc=Glowstone Bismuth Panel
|
tile.lightstone.15.desc=Glowstone Bismuth Panel
|
||||||
|
|
||||||
# Lapis blocks
|
# Lapis blocks
|
||||||
tile.chisel.lapis_block.name=Lapis Block
|
tile.chisel.lapis_block.name=Lapis Lazuli Block
|
||||||
tile.lapis.1.desc=Chunky Lapis Block
|
tile.lapis.1.desc=Chunky Lapis Block
|
||||||
tile.lapis.2.desc=Dark Lapis Block
|
tile.lapis.2.desc=Dark Lapis Block
|
||||||
tile.lapis.3.desc=Zelda Lapis Block
|
tile.lapis.3.desc=Zelda Lapis Block
|
||||||
@@ -847,7 +847,7 @@ tile.lapis.7.desc=Smooth Lapis
|
|||||||
tile.lapis.8.desc=Lapis with Ornate Layer
|
tile.lapis.8.desc=Lapis with Ornate Layer
|
||||||
|
|
||||||
# Emerald Blocks
|
# Emerald Blocks
|
||||||
tile.chisel.emerald_block.name=Emerald Block
|
tile.chisel.emerald_block.name=Block of Emerald
|
||||||
tile.emerald.1.desc=Emerald Panel
|
tile.emerald.1.desc=Emerald Panel
|
||||||
tile.emerald.2.desc=Classic emerald Panel
|
tile.emerald.2.desc=Classic emerald Panel
|
||||||
tile.emerald.3.desc=Smooth Emerald
|
tile.emerald.3.desc=Smooth Emerald
|
||||||
@@ -1108,7 +1108,7 @@ tile.glass_pane.14.desc=Japanese Glass Pane
|
|||||||
tile.glass_pane.15.desc=Ornate Japanese Glass Pane
|
tile.glass_pane.15.desc=Ornate Japanese Glass Pane
|
||||||
|
|
||||||
# Redstone block
|
# Redstone block
|
||||||
tile.chisel.redstone_block.name=Redstone Block
|
tile.chisel.redstone_block.name=Block of Redstone
|
||||||
tile.redstone_block.1.desc=Smooth Redstone
|
tile.redstone_block.1.desc=Smooth Redstone
|
||||||
tile.redstone_block.2.desc=Large Redstone Block
|
tile.redstone_block.2.desc=Large Redstone Block
|
||||||
tile.redstone_block.3.desc=Small Redstone Block
|
tile.redstone_block.3.desc=Small Redstone Block
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ tile.beacon.blue.desc=Blue Beamed Beacon
|
|||||||
tile.beacon.brown.desc=Brown Beamed Beacon
|
tile.beacon.brown.desc=Brown Beamed Beacon
|
||||||
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
||||||
tile.beacon.green.desc=Green Beamed Beacon
|
tile.beacon.green.desc=Green Beamed Beacon
|
||||||
tile.beacon.lightblue.desc=Light Blue Beamed Beacon
|
tile.beacon.lightBlue.desc=Light Blue Beamed Beacon
|
||||||
tile.beacon.silver.desc=Light Gray Beamed Beacon
|
tile.beacon.silver.desc=Light Gray Beamed Beacon
|
||||||
tile.beacon.lime.desc=Lime Beamed Beacon
|
tile.beacon.lime.desc=Lime Beamed Beacon
|
||||||
tile.beacon.magenta.desc=Magenta Beamed Beacon
|
tile.beacon.magenta.desc=Magenta Beamed Beacon
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ tile.beacon.blue.desc=Blue Beamed Beacon
|
|||||||
tile.beacon.brown.desc=Brown Beamed Beacon
|
tile.beacon.brown.desc=Brown Beamed Beacon
|
||||||
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
||||||
tile.beacon.green.desc=Green Beamed Beacon
|
tile.beacon.green.desc=Green Beamed Beacon
|
||||||
tile.beacon.lightblue.desc=Light Blue Beamed Beacon
|
tile.beacon.lightBlue.desc=Light Blue Beamed Beacon
|
||||||
tile.beacon.silver.desc=Light Gray Beamed Beacon
|
tile.beacon.silver.desc=Light Gray Beamed Beacon
|
||||||
tile.beacon.lime.desc=Lime Beamed Beacon
|
tile.beacon.lime.desc=Lime Beamed Beacon
|
||||||
tile.beacon.magenta.desc=Magenta Beamed Beacon
|
tile.beacon.magenta.desc=Magenta Beamed Beacon
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ tile.beacon.blue.desc=Blue Beamed Beacon
|
|||||||
tile.beacon.brown.desc=Brown Beamed Beacon
|
tile.beacon.brown.desc=Brown Beamed Beacon
|
||||||
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
tile.beacon.cyan.desc=Cyan Beamed Beacon
|
||||||
tile.beacon.green.desc=Green Beamed Beacon
|
tile.beacon.green.desc=Green Beamed Beacon
|
||||||
tile.beacon.lightblue.desc=Light Blue Beamed Beacon
|
tile.beacon.lightBlue.desc=Light Blue Beamed Beacon
|
||||||
tile.beacon.silver.desc=Light Gray Beamed Beacon
|
tile.beacon.silver.desc=Light Gray Beamed Beacon
|
||||||
tile.beacon.lime.desc=Lime Beamed Beacon
|
tile.beacon.lime.desc=Lime Beamed Beacon
|
||||||
tile.beacon.magenta.desc=Magenta Beamed Beacon
|
tile.beacon.magenta.desc=Magenta Beamed Beacon
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ tile.beacon.blue.desc=Маяк с синем лучом
|
|||||||
tile.beacon.brown.desc=Маяк с коричневым лучом
|
tile.beacon.brown.desc=Маяк с коричневым лучом
|
||||||
tile.beacon.cyan.desc=Маяк с бирюзовым лучом
|
tile.beacon.cyan.desc=Маяк с бирюзовым лучом
|
||||||
tile.beacon.green.desc=Маяк с зелёным лучом
|
tile.beacon.green.desc=Маяк с зелёным лучом
|
||||||
tile.beacon.lightblue.desc=Маяк со голубым лучом
|
tile.beacon.lightBlue.desc=Маяк со голубым лучом
|
||||||
tile.beacon.silver.desc=Маяк со светло-серым лучом
|
tile.beacon.silver.desc=Маяк со светло-серым лучом
|
||||||
tile.beacon.lime.desc=Маяк с лаймовым лучом
|
tile.beacon.lime.desc=Маяк с лаймовым лучом
|
||||||
tile.beacon.magenta.desc=Маяк с сиреневым лучом
|
tile.beacon.magenta.desc=Маяк с сиреневым лучом
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ tile.beacon.blue.desc=蓝色定向信标
|
|||||||
tile.beacon.brown.desc=棕色定向信标
|
tile.beacon.brown.desc=棕色定向信标
|
||||||
tile.beacon.cyan.desc=青色定向信标
|
tile.beacon.cyan.desc=青色定向信标
|
||||||
tile.beacon.green.desc=绿色定向信标
|
tile.beacon.green.desc=绿色定向信标
|
||||||
tile.beacon.lightblue.desc=淡蓝定向信标
|
tile.beacon.lightBlue.desc=淡蓝定向信标
|
||||||
tile.beacon.silver.desc=淡灰定向信标
|
tile.beacon.silver.desc=淡灰定向信标
|
||||||
tile.beacon.lime.desc=黄绿定向信标
|
tile.beacon.lime.desc=黄绿定向信标
|
||||||
tile.beacon.magenta.desc=品红定向信标
|
tile.beacon.magenta.desc=品红定向信标
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 288 B |
|
After Width: | Height: | Size: 252 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 333 B |
|
After Width: | Height: | Size: 323 B |
|
After Width: | Height: | Size: 240 B |
|
After Width: | Height: | Size: 328 B |
|
After Width: | Height: | Size: 282 B |