mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5cb0935e9 | ||
|
|
d4f79882f9 | ||
|
|
8d3685439e | ||
|
|
68cf703435 | ||
|
|
bcdd04d549 | ||
|
|
ec7d9d4179 | ||
|
|
765da1aca8 | ||
|
|
7fa42ca064 | ||
|
|
c23ea1e733 | ||
|
|
0f48e851a3 | ||
|
|
549007a4a6 | ||
|
|
932e7c84b3 | ||
|
|
999b5df933 | ||
|
|
29396b6235 | ||
|
|
4ce32c3663 | ||
|
|
8084cc5499 | ||
|
|
988fc97af1 | ||
|
|
5f082045b0 | ||
|
|
abc98ba56b | ||
|
|
e35c5c9ae4 | ||
|
|
926fa5d5a6 | ||
|
|
99d8fa1a6b | ||
|
|
1a317a7306 | ||
|
|
fa01ba3221 | ||
|
|
766019e1fc | ||
|
|
a7e4cdcc49 | ||
|
|
6551ccc247 | ||
|
|
c3e4d303e9 | ||
|
|
9e763a8334 | ||
|
|
035c01e222 | ||
|
|
1fa88ebd56 | ||
|
|
4fce4eb10b | ||
|
|
2e694d3a6d | ||
|
|
e8966a05f5 | ||
|
|
a377727ac4 | ||
|
|
385fb64ab7 | ||
|
|
f2216f4e25 | ||
|
|
0fc1ea01d1 | ||
|
|
ea23cd4779 | ||
|
|
903a400132 | ||
|
|
940f3ed731 | ||
|
|
9d8817b5db | ||
|
|
10204f8d82 | ||
|
|
746d702058 | ||
|
|
3c5728f070 | ||
|
|
8c8ef2d9e1 | ||
|
|
6a25490d7f | ||
|
|
6a0b16817d | ||
|
|
677e2104a0 | ||
|
|
438c969fef | ||
|
|
4af0bfd661 | ||
|
|
03c2a3d3a8 | ||
|
|
9a6d1c390e | ||
|
|
0512a47eba | ||
|
|
699a5c3c18 | ||
|
|
5a552b9f8d | ||
|
|
aa5b9d12ea | ||
|
|
a3b1007633 | ||
|
|
bdd0af5280 | ||
|
|
5e554530ac | ||
|
|
713c24d916 | ||
|
|
c359a38d9f | ||
|
|
d84a88d78d | ||
|
|
cf9b1b2193 | ||
|
|
25605505d5 | ||
|
|
0d2a0deef3 | ||
|
|
b6dc5381ca | ||
|
|
559bacbd98 | ||
|
|
19444ffa18 | ||
|
|
db3d202c4e | ||
|
|
2f5172f907 | ||
|
|
f6cb5268a2 | ||
|
|
fcee09cab2 | ||
|
|
dd1d8737ad | ||
|
|
3e48066021 | ||
|
|
0d16042705 | ||
|
|
52b8070692 | ||
|
|
23541ab175 | ||
|
|
c7a17946a5 | ||
|
|
208ca23515 | ||
|
|
6329c0fcf2 | ||
|
|
202ae50820 | ||
|
|
58e5f33fad | ||
|
|
2ce4f5ece5 | ||
|
|
aca45340bf | ||
|
|
30d4520c6b | ||
|
|
daff482092 | ||
|
|
a740044e21 | ||
|
|
1a4955f9fd | ||
|
|
2c4042c17c | ||
|
|
e95ba8a3dc | ||
|
|
63cb030cba | ||
|
|
743fc70a7f | ||
|
|
c14ffa3264 | ||
|
|
3f292d5d42 | ||
|
|
886e89ccb2 | ||
|
|
977428e42c | ||
|
|
1c02312ae6 | ||
|
|
8fbd84515f | ||
|
|
f93289e01c |
No files matched your search
Vendored
+3
-10
@@ -6,8 +6,8 @@ pipeline {
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'gradlewrapper:latest'
|
||||
args '-v gradlecache:/gradlecache'
|
||||
image 'gradle:jdk8'
|
||||
args '-v forgegc:/home/gradle/.gradle/'
|
||||
}
|
||||
}
|
||||
environment {
|
||||
@@ -18,11 +18,6 @@ pipeline {
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('fetch') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
stage('notify_start') {
|
||||
when {
|
||||
not {
|
||||
@@ -91,9 +86,7 @@ pipeline {
|
||||
always {
|
||||
script {
|
||||
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
|
||||
//junit 'build/test-results/*/*.xml'
|
||||
//jacoco sourcePattern: '**/src/*/java'
|
||||
|
||||
|
||||
if (env.CHANGE_ID == null) { // This is unset for non-PRs
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
|
||||
|
||||
+23
-14
@@ -52,6 +52,8 @@ plugins {
|
||||
}
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version'))
|
||||
|
||||
ext {
|
||||
JAR_SIGNER = null
|
||||
if (project.hasProperty('keystore')) {
|
||||
@@ -62,9 +64,9 @@ ext {
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'snapshot'
|
||||
MAPPING_VERSION = '20190719-1.14.3'
|
||||
MAPPING_VERSION = '20200514-1.15.1'
|
||||
MC_VERSION = '1.15.2'
|
||||
MCP_VERSION = '20200122.131323'
|
||||
MCP_VERSION = '20200515.085601'
|
||||
}
|
||||
|
||||
project(':mcp') {
|
||||
@@ -203,7 +205,7 @@ project(':forge') {
|
||||
}
|
||||
|
||||
ext {
|
||||
SPEC_VERSION = '30.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
SPEC_VERSION = '31.2' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
// The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB>
|
||||
// ForgeMC is a unique identifier for every MC version we have supported.
|
||||
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
|
||||
@@ -230,6 +232,7 @@ project(':forge') {
|
||||
}
|
||||
|
||||
version = getVersion()
|
||||
println('Forge Version: ' + version)
|
||||
|
||||
patcher {
|
||||
exc = file("$rootDir/src/main/resources/forge.exc")
|
||||
@@ -429,18 +432,18 @@ project(':forge') {
|
||||
installer 'org.ow2.asm:asm:7.2'
|
||||
installer 'org.ow2.asm:asm-commons:7.2'
|
||||
installer 'org.ow2.asm:asm-tree:7.2'
|
||||
installer 'cpw.mods:modlauncher:5.0.+'
|
||||
installer 'cpw.mods:grossjava9hacks:1.1.+'
|
||||
installer 'net.minecraftforge:accesstransformers:2.0.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:2.0.+:service'
|
||||
installer 'net.minecraftforge:forgespi:2.0.+'
|
||||
installer 'cpw.mods:modlauncher:5.1.+'
|
||||
installer 'cpw.mods:grossjava9hacks:1.3.+'
|
||||
installer 'net.minecraftforge:accesstransformers:2.1.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:2.2.+:service'
|
||||
installer 'net.minecraftforge:forgespi:2.1.+'
|
||||
installer 'net.minecraftforge:coremods:2.0.+'
|
||||
installer 'net.minecraftforge:unsafe:0.2.+'
|
||||
installer 'com.electronwill.night-config:core:3.6.2'
|
||||
installer 'com.electronwill.night-config:toml:3.6.2'
|
||||
installer 'org.jline:jline:3.12.+'
|
||||
installer 'org.apache.maven:maven-artifact:3.6.0'
|
||||
installer 'net.jodah:typetools:0.6.1'
|
||||
installer 'net.jodah:typetools:0.8.+'
|
||||
installer 'org.apache.logging.log4j:log4j-api:2.11.2'
|
||||
installer 'org.apache.logging.log4j:log4j-core:2.11.2'
|
||||
installer 'net.minecrell:terminalconsoleappender:1.2.+'
|
||||
@@ -1316,12 +1319,18 @@ def getArtifacts(project, config, classifiers) {
|
||||
}
|
||||
|
||||
def checkExists(url) {
|
||||
def code = new URL(url).openConnection().with {
|
||||
requestMethod = 'HEAD'
|
||||
connect()
|
||||
responseCode
|
||||
try {
|
||||
def code = new URL(url).openConnection().with {
|
||||
requestMethod = 'HEAD'
|
||||
connect()
|
||||
responseCode
|
||||
}
|
||||
return code == 200
|
||||
} catch (Exception e) {
|
||||
if (e.toString().contains('unable to find valid certification path to requested target'))
|
||||
throw new RuntimeException('Failed to connect to ' + url + ': Missing certificate root authority, try updating java')
|
||||
throw e
|
||||
}
|
||||
return code == 200
|
||||
}
|
||||
|
||||
def getClasspath(project, libs, artifact) {
|
||||
|
||||
+4
-4
@@ -2,16 +2,16 @@
|
||||
|
||||
MinecraftForge
|
||||
=============
|
||||
[](https://files.minecraftforge.net)
|
||||
[](https://files.minecraftforge.net)
|
||||
[](https://files.minecraftforge.net) [](https://discord.gg/UvedJ9m) [](https://www.patreon.com/LexManos) [](https://forgedev.flocker.tv/)
|
||||
|
||||
Forge is a free, open-source modding API all of your favourite mods use!
|
||||
|
||||
| Version | Support |
|
||||
| ------------- | ------------- |
|
||||
| 1.14.x | Active |
|
||||
| 1.12.x | Legacy |
|
||||
| 1.15.x | Active |
|
||||
| 1.14.x | LTS |
|
||||
|
||||
* [Download]
|
||||
* [Forum]
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
+6
-9
@@ -127,18 +127,15 @@ jar {
|
||||
}
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish task
|
||||
// we define a custom artifact that is sourced from the reobfJar output task
|
||||
// and then declare that to be published
|
||||
// Note you'll need to add a repository here
|
||||
def reobfFile = file("$buildDir/reobfJar/output.jar")
|
||||
def reobfArtifact = artifacts.add('default', reobfFile) {
|
||||
type 'jar'
|
||||
builtBy 'reobfJar'
|
||||
}
|
||||
// This is the preferred method to reobfuscate your jar file
|
||||
jar.finalizedBy('reobfJar')
|
||||
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
|
||||
//publish.dependsOn('reobfJar')
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact reobfArtifact
|
||||
artifact jar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
@@ -578,10 +578,17 @@
|
||||
@@ -579,10 +579,17 @@
|
||||
GL13.glClientActiveTexture(p_227747_0_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/vertex/IVertexBuilder.java
|
||||
+++ b/com/mojang/blaze3d/vertex/IVertexBuilder.java
|
||||
@@ -17,7 +17,7 @@
|
||||
@@ -18,7 +18,7 @@
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -9,7 +9,7 @@
|
||||
Logger field_227884_f_ = LogManager.getLogger();
|
||||
|
||||
IVertexBuilder func_225582_a_(double p_225582_1_, double p_225582_3_, double p_225582_5_);
|
||||
@@ -95,11 +95,12 @@
|
||||
@@ -96,11 +96,12 @@
|
||||
f5 = p_227890_3_[k] * p_227890_6_;
|
||||
}
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
|
||||
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
|
||||
@@ -64,6 +64,15 @@
|
||||
super.tick();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean keyPressed(int key, int scanCode, int modifiers) {
|
||||
+ if (key == org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE) {
|
||||
+ Realms.setScreen(this.field_224228_a);
|
||||
+ return true;
|
||||
+ }
|
||||
+ return super.keyPressed(key, scanCode, modifiers);
|
||||
+ }
|
||||
+
|
||||
public void render(int p_render_1_, int p_render_2_, float p_render_3_) {
|
||||
this.renderBackground();
|
||||
this.drawCenteredString(this.field_224229_b, this.width() / 2, 80, 16777215);
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/advancements/AdvancementList.java
|
||||
+++ b/net/minecraft/advancements/AdvancementList.java
|
||||
@@ -96,6 +96,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ net.minecraftforge.common.AdvancementLoadFix.buildSortedTrees(this.field_192093_c);
|
||||
field_192091_a.info("Loaded {} advancements", (int)this.field_192092_b.size());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
--- a/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -187,6 +187,8 @@
|
||||
@@ -154,6 +154,7 @@
|
||||
}
|
||||
|
||||
this.func_192748_e();
|
||||
+ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.field_192759_g, this.field_192760_h, this.field_192758_f, this.field_192761_i, this::func_192738_c); else
|
||||
this.func_192752_d();
|
||||
this.func_192751_c();
|
||||
}
|
||||
@@ -187,6 +188,8 @@
|
||||
}
|
||||
|
||||
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
|
||||
@@ -9,7 +17,7 @@
|
||||
boolean flag = false;
|
||||
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
|
||||
boolean flag1 = advancementprogress.func_192105_a();
|
||||
@@ -199,6 +201,7 @@
|
||||
@@ -199,6 +202,7 @@
|
||||
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
|
||||
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/net/minecraft/block/BambooBlock.java
|
||||
+++ b/net/minecraft/block/BambooBlock.java
|
||||
@@ -91,10 +91,11 @@
|
||||
if (!p_225534_1_.func_196955_c(p_225534_2_, p_225534_3_)) {
|
||||
p_225534_2_.func_175655_b(p_225534_3_, true);
|
||||
} else if (p_225534_1_.func_177229_b(field_220266_f) == 0) {
|
||||
- if (p_225534_4_.nextInt(3) == 0 && p_225534_2_.func_175623_d(p_225534_3_.func_177984_a()) && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9) {
|
||||
+ if (true) {
|
||||
int i = this.func_220260_b(p_225534_2_, p_225534_3_) + 1;
|
||||
- if (i < 16) {
|
||||
+ if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_4_.nextInt(3) == 0 && p_225534_2_.func_175623_d(p_225534_3_.func_177984_a()) && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9)) {
|
||||
this.func_220258_a(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_, i);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
@Deprecated
|
||||
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
|
||||
- if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
+ if (p_196243_1_.hasTileEntity() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
+ if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() || !p_196243_4_.hasTileEntity())) {
|
||||
p_196243_2_.func_175713_t(p_196243_3_);
|
||||
}
|
||||
-
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
for(Direction direction : Direction.values()) {
|
||||
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
|
||||
- i = Math.max(this.func_220275_r(blockstate), i);
|
||||
+ i = Math.max(blockstate.getFlammability(p_176538_1_, p_176538_2_.func_177972_a(direction), direction.func_176734_d()), i);
|
||||
+ i = Math.max(blockstate.getFireSpreadSpeed(p_176538_1_, p_176538_2_.func_177972_a(direction), direction.func_176734_d()), i);
|
||||
}
|
||||
|
||||
return i;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
+ *
|
||||
+ * @param emptyPot The empty pot for this pot, or null for self.
|
||||
+ * @param p_i48395_1_ The flower block.
|
||||
+ * @param p_i48395_2_
|
||||
+ * @param properties
|
||||
+ */
|
||||
+ public FlowerPotBlock(@javax.annotation.Nullable java.util.function.Supplier<FlowerPotBlock> emptyPot, java.util.function.Supplier<? extends Block> p_i48395_1_, Block.Properties p_i48395_2_) {
|
||||
super(p_i48395_2_);
|
||||
|
||||
@@ -9,17 +9,18 @@
|
||||
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
@@ -60,7 +60,9 @@
|
||||
if (p_225533_2_.field_72995_K) {
|
||||
return ActionResultType.SUCCESS;
|
||||
} else {
|
||||
- p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c);
|
||||
+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_225533_2_, p_225533_3_, p_225533_1_, p_225533_1_.func_177229_b(field_196485_c), p_225533_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c));
|
||||
+ if (_new == -1) return ActionResultType.FAIL;
|
||||
+ p_225533_1_ = (BlockState)p_225533_1_.func_206870_a(field_196485_c, _new);
|
||||
p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c);
|
||||
p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3);
|
||||
this.func_196482_a(p_225533_2_, p_225533_3_);
|
||||
@@ -76,6 +79,9 @@
|
||||
p_225533_4_.func_195066_a(Stats.field_188087_U);
|
||||
@@ -76,6 +78,9 @@
|
||||
}
|
||||
|
||||
public boolean func_189539_a(BlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/client/MainWindow.java
|
||||
+++ b/net/minecraft/client/MainWindow.java
|
||||
@@ -86,7 +86,7 @@
|
||||
GLFW.glfwWindowHint(139266, 2);
|
||||
GLFW.glfwWindowHint(139267, 0);
|
||||
GLFW.glfwWindowHint(139272, 0);
|
||||
- this.field_198119_f = GLFW.glfwCreateWindow(this.field_198129_p, this.field_198130_q, p_i51170_5_, this.field_198125_l && monitor != null ? monitor.func_197995_f() : 0L, 0L);
|
||||
+ this.field_198119_f = net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.handOffWindow(()->this.field_198129_p, ()->this.field_198130_q, ()->p_i51170_5_, ()->this.field_198125_l && monitor != null ? monitor.func_197995_f() : 0L);
|
||||
if (monitor != null) {
|
||||
VideoMode videomode = monitor.func_197992_a(this.field_198125_l ? this.field_198124_k : Optional.empty());
|
||||
this.field_198120_g = this.field_198127_n = monitor.func_197989_c() + videomode.func_198064_a() / 2 - this.field_198129_p / 2;
|
||||
@@ -16,15 +16,16 @@
|
||||
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
|
||||
this.field_147129_ai = func_147122_X();
|
||||
this.field_71437_Z = null;
|
||||
@@ -368,6 +368,7 @@
|
||||
screensize = p_i45547_1_.field_178743_b;
|
||||
@@ -350,7 +350,7 @@
|
||||
i = 0;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.join();
|
||||
Util.field_211180_a = RenderSystem.initBackendSystem();
|
||||
this.field_195557_T = new VirtualScreen(this);
|
||||
this.field_195558_d = this.field_195557_T.func_217626_a(screensize, this.field_71474_y.field_198019_u, this.func_230149_ax_());
|
||||
@@ -383,13 +384,13 @@
|
||||
- Bootstrap.func_151354_b();
|
||||
+ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.func_151354_b(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick);
|
||||
Bootstrap.func_218821_c();
|
||||
KeybindTextComponent.field_193637_b = KeyBinding::func_193626_b;
|
||||
this.field_184131_U = DataFixesManager.func_210901_a();
|
||||
@@ -383,13 +383,13 @@
|
||||
|
||||
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
|
||||
this.field_71417_B = new MouseHelper(this);
|
||||
@@ -39,7 +40,7 @@
|
||||
this.field_71474_y.func_198017_a(this.field_110448_aq);
|
||||
this.field_110448_aq.func_198983_a();
|
||||
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
|
||||
@@ -434,12 +435,14 @@
|
||||
@@ -434,12 +434,14 @@
|
||||
this.func_193986_ar();
|
||||
this.field_110451_am.func_219534_a(this.field_193995_ae);
|
||||
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
|
||||
@@ -55,7 +56,7 @@
|
||||
this.field_184132_p = new DebugRenderer(this);
|
||||
RenderSystem.setErrorCallback(this::func_195545_a);
|
||||
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
|
||||
@@ -451,12 +454,11 @@
|
||||
@@ -451,12 +453,11 @@
|
||||
this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E);
|
||||
this.field_195558_d.func_227801_c_();
|
||||
this.func_213226_a();
|
||||
@@ -72,7 +73,7 @@
|
||||
ResourceLoadProgressGui.func_212970_a(this);
|
||||
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
|
||||
this.func_213268_a(new ResourceLoadProgressGui(this, this.field_110451_am.func_219537_a(Util.func_215072_e(), this, field_223714_G, list), (p_229990_2_) -> {
|
||||
@@ -466,6 +468,14 @@
|
||||
@@ -466,6 +467,14 @@
|
||||
this.func_213256_aB();
|
||||
}
|
||||
|
||||
@@ -87,7 +88,16 @@
|
||||
});
|
||||
}, false));
|
||||
}
|
||||
@@ -579,7 +589,7 @@
|
||||
@@ -505,7 +514,7 @@
|
||||
}
|
||||
|
||||
private void func_229988_a_(Throwable p_229988_1_) {
|
||||
- if (this.field_110448_aq.func_198980_d().size() > 1) {
|
||||
+ if (this.field_110448_aq.func_198980_d().stream().anyMatch(e -> !e.func_195797_g())) { //Forge: This caused infinite loop if any resource packs are forced. Such as mod resources. So check if we can disable any.
|
||||
ITextComponent itextcomponent;
|
||||
if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) {
|
||||
itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_230028_a().func_195762_a());
|
||||
@@ -579,7 +588,7 @@
|
||||
return Stream.of(Registry.field_212630_s.func_177774_c(p_213251_0_.func_77973_b()));
|
||||
});
|
||||
SearchTreeReloadable<ItemStack> searchtreereloadable = new SearchTreeReloadable<>((p_213235_0_) -> {
|
||||
@@ -96,7 +106,7 @@
|
||||
});
|
||||
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
|
||||
|
||||
@@ -667,13 +677,13 @@
|
||||
@@ -667,13 +676,13 @@
|
||||
Bootstrap.func_179870_a(p_71377_0_.func_71502_e());
|
||||
if (p_71377_0_.func_71497_f() != null) {
|
||||
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_0_.func_71497_f());
|
||||
@@ -113,7 +123,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -682,6 +692,7 @@
|
||||
@@ -682,6 +691,7 @@
|
||||
return this.field_71474_y.field_211842_aO;
|
||||
}
|
||||
|
||||
@@ -121,7 +131,7 @@
|
||||
public CompletableFuture<Void> func_213237_g() {
|
||||
if (this.field_213276_aV != null) {
|
||||
return this.field_213276_aV;
|
||||
@@ -760,10 +771,6 @@
|
||||
@@ -760,10 +770,6 @@
|
||||
}
|
||||
|
||||
public void func_147108_a(@Nullable Screen p_147108_1_) {
|
||||
@@ -132,7 +142,7 @@
|
||||
if (p_147108_1_ == null && this.field_71441_e == null) {
|
||||
p_147108_1_ = new MainMenuScreen();
|
||||
} else if (p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
|
||||
@@ -774,6 +781,14 @@
|
||||
@@ -774,6 +780,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +157,7 @@
|
||||
if (p_147108_1_ instanceof MainMenuScreen || p_147108_1_ instanceof MultiplayerScreen) {
|
||||
this.field_71474_y.field_74330_P = false;
|
||||
this.field_71456_v.func_146158_b().func_146231_a(true);
|
||||
@@ -905,11 +920,13 @@
|
||||
@@ -905,11 +919,13 @@
|
||||
RenderSystem.enableTexture();
|
||||
this.field_71424_I.func_76319_b();
|
||||
if (!this.field_71454_w) {
|
||||
@@ -161,7 +171,16 @@
|
||||
}
|
||||
|
||||
this.field_71424_I.func_219897_b();
|
||||
@@ -1164,11 +1181,21 @@
|
||||
@@ -976,7 +992,7 @@
|
||||
|
||||
Framebuffer framebuffer = this.func_147110_a();
|
||||
framebuffer.func_216491_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l(), field_142025_a);
|
||||
- this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
|
||||
+ if (this.field_71460_t!=null) this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
|
||||
this.field_71417_B.func_198021_g();
|
||||
}
|
||||
|
||||
@@ -1164,11 +1180,21 @@
|
||||
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) {
|
||||
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
|
||||
BlockPos blockpos = blockraytraceresult.func_216350_a();
|
||||
@@ -185,7 +204,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1187,6 +1214,8 @@
|
||||
@@ -1187,6 +1213,8 @@
|
||||
}
|
||||
|
||||
} else if (!this.field_71439_g.func_184838_M()) {
|
||||
@@ -194,7 +213,7 @@
|
||||
switch(this.field_71476_x.func_216346_c()) {
|
||||
case ENTITY:
|
||||
this.field_71442_b.func_78764_a(this.field_71439_g, ((EntityRayTraceResult)this.field_71476_x).func_216348_a());
|
||||
@@ -1194,7 +1223,7 @@
|
||||
@@ -1194,7 +1222,7 @@
|
||||
case BLOCK:
|
||||
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
|
||||
BlockPos blockpos = blockraytraceresult.func_216350_a();
|
||||
@@ -203,7 +222,7 @@
|
||||
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
|
||||
break;
|
||||
}
|
||||
@@ -1204,8 +1233,10 @@
|
||||
@@ -1204,8 +1232,10 @@
|
||||
}
|
||||
|
||||
this.field_71439_g.func_184821_cY();
|
||||
@@ -214,7 +233,7 @@
|
||||
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1220,6 +1251,11 @@
|
||||
@@ -1220,6 +1250,11 @@
|
||||
}
|
||||
|
||||
for(Hand hand : Hand.values()) {
|
||||
@@ -226,7 +245,7 @@
|
||||
ItemStack itemstack = this.field_71439_g.func_184586_b(hand);
|
||||
if (this.field_71476_x != null) {
|
||||
switch(this.field_71476_x.func_216346_c()) {
|
||||
@@ -1233,6 +1269,7 @@
|
||||
@@ -1233,6 +1268,7 @@
|
||||
|
||||
if (actionresulttype.func_226246_a_()) {
|
||||
if (actionresulttype.func_226247_b_()) {
|
||||
@@ -234,7 +253,7 @@
|
||||
this.field_71439_g.func_184609_a(hand);
|
||||
}
|
||||
|
||||
@@ -1245,6 +1282,7 @@
|
||||
@@ -1245,6 +1281,7 @@
|
||||
ActionResultType actionresulttype1 = this.field_71442_b.func_217292_a(this.field_71439_g, this.field_71441_e, hand, blockraytraceresult);
|
||||
if (actionresulttype1.func_226246_a_()) {
|
||||
if (actionresulttype1.func_226247_b_()) {
|
||||
@@ -242,7 +261,7 @@
|
||||
this.field_71439_g.func_184609_a(hand);
|
||||
if (!itemstack.func_190926_b() && (itemstack.func_190916_E() != i || this.field_71442_b.func_78758_h())) {
|
||||
this.field_71460_t.field_78516_c.func_187460_a(hand);
|
||||
@@ -1260,6 +1298,9 @@
|
||||
@@ -1260,6 +1297,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +271,7 @@
|
||||
if (!itemstack.func_190926_b()) {
|
||||
ActionResultType actionresulttype2 = this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand);
|
||||
if (actionresulttype2.func_226246_a_()) {
|
||||
@@ -1286,6 +1327,8 @@
|
||||
@@ -1286,6 +1326,8 @@
|
||||
--this.field_71467_ac;
|
||||
}
|
||||
|
||||
@@ -261,7 +280,7 @@
|
||||
this.field_71424_I.func_76320_a("gui");
|
||||
if (!this.field_71445_n) {
|
||||
this.field_71456_v.func_73831_a();
|
||||
@@ -1403,6 +1446,8 @@
|
||||
@@ -1403,6 +1445,8 @@
|
||||
this.field_71424_I.func_219895_b("keyboard");
|
||||
this.field_195559_v.func_204870_b();
|
||||
this.field_71424_I.func_76319_b();
|
||||
@@ -270,7 +289,7 @@
|
||||
}
|
||||
|
||||
private void func_184117_aA() {
|
||||
@@ -1557,6 +1602,12 @@
|
||||
@@ -1557,6 +1601,12 @@
|
||||
this.func_147108_a(worldloadprogressscreen);
|
||||
|
||||
while(!this.field_71437_Z.func_71200_ad()) {
|
||||
@@ -283,7 +302,7 @@
|
||||
worldloadprogressscreen.tick();
|
||||
this.func_195542_b(false);
|
||||
|
||||
@@ -1577,11 +1628,17 @@
|
||||
@@ -1577,11 +1627,17 @@
|
||||
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_229998_0_) -> {
|
||||
}));
|
||||
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
|
||||
@@ -302,7 +321,7 @@
|
||||
WorkingScreen workingscreen = new WorkingScreen();
|
||||
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
|
||||
this.func_213241_c(workingscreen);
|
||||
@@ -1613,10 +1670,12 @@
|
||||
@@ -1613,10 +1669,12 @@
|
||||
IntegratedServer integratedserver = this.field_71437_Z;
|
||||
this.field_71437_Z = null;
|
||||
this.field_71460_t.func_190564_k();
|
||||
@@ -315,7 +334,7 @@
|
||||
if (integratedserver != null) {
|
||||
while(!integratedserver.func_213201_w()) {
|
||||
this.func_195542_b(false);
|
||||
@@ -1627,6 +1686,7 @@
|
||||
@@ -1627,6 +1685,7 @@
|
||||
this.field_71456_v.func_181029_i();
|
||||
this.field_71422_O = null;
|
||||
this.field_71455_al = false;
|
||||
@@ -323,7 +342,7 @@
|
||||
this.field_213274_aO.func_216815_b();
|
||||
}
|
||||
|
||||
@@ -1649,6 +1709,7 @@
|
||||
@@ -1649,6 +1708,7 @@
|
||||
this.field_71452_i.func_78870_a(p_213257_1_);
|
||||
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
|
||||
this.func_230150_b_();
|
||||
@@ -331,7 +350,7 @@
|
||||
}
|
||||
|
||||
public final boolean func_71355_q() {
|
||||
@@ -1674,112 +1735,9 @@
|
||||
@@ -1674,112 +1734,9 @@
|
||||
|
||||
private void func_147112_ai() {
|
||||
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
|
||||
@@ -447,7 +466,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1861,6 +1819,7 @@
|
||||
@@ -1861,6 +1818,7 @@
|
||||
return field_71432_P;
|
||||
}
|
||||
|
||||
@@ -455,7 +474,7 @@
|
||||
public CompletableFuture<Void> func_213245_w() {
|
||||
return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> {
|
||||
return p_229993_0_;
|
||||
@@ -1988,6 +1947,8 @@
|
||||
@@ -1988,6 +1946,8 @@
|
||||
}
|
||||
|
||||
public MusicTicker.MusicType func_147109_W() {
|
||||
@@ -464,7 +483,7 @@
|
||||
if (this.field_71462_r instanceof WinGameScreen) {
|
||||
return MusicTicker.MusicType.CREDITS;
|
||||
} else if (this.field_71439_g == null) {
|
||||
@@ -2164,7 +2125,7 @@
|
||||
@@ -2164,7 +2124,7 @@
|
||||
supplier = func_228022_c_(supplier);
|
||||
}
|
||||
|
||||
@@ -473,7 +492,7 @@
|
||||
}
|
||||
|
||||
private static Supplier<IResourcePack> func_228021_b_(Supplier<IResourcePack> p_228021_0_) {
|
||||
@@ -2182,4 +2143,12 @@
|
||||
@@ -2182,4 +2142,12 @@
|
||||
public void func_228020_b_(int p_228020_1_) {
|
||||
this.field_175617_aL.func_229355_a_(p_228020_1_);
|
||||
}
|
||||
|
||||
@@ -40,3 +40,12 @@
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
@@ -1045,7 +1056,7 @@
|
||||
ItemStack itemstack = this.field_73839_d.field_71439_g.field_71071_by.func_70448_g();
|
||||
if (itemstack.func_190926_b()) {
|
||||
this.field_92017_k = 0;
|
||||
- } else if (!this.field_92016_l.func_190926_b() && itemstack.func_77973_b() == this.field_92016_l.func_77973_b() && itemstack.func_200301_q().equals(this.field_92016_l.func_200301_q())) {
|
||||
+ } else if (!this.field_92016_l.func_190926_b() && itemstack.func_77973_b() == this.field_92016_l.func_77973_b() && (itemstack.func_200301_q().equals(this.field_92016_l.func_200301_q()) && itemstack.getHighlightTip(itemstack.func_200301_q().func_150261_e()).equals(field_92016_l.getHighlightTip(field_92016_l.func_200301_q().func_150261_e())))) {
|
||||
if (this.field_92017_k > 0) {
|
||||
--this.field_92017_k;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/net/minecraft/client/gui/screen/MultiplayerScreen.java
|
||||
+++ b/net/minecraft/client/gui/screen/MultiplayerScreen.java
|
||||
@@ -241,6 +241,11 @@
|
||||
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onClose() {
|
||||
+ this.minecraft.func_147108_a(this.field_146798_g);
|
||||
+ }
|
||||
+
|
||||
public ServerPinger func_146789_i() {
|
||||
return this.field_146797_f;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/net/minecraft/client/gui/screen/OptionsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screen/OptionsScreen.java
|
||||
@@ -118,4 +118,12 @@
|
||||
this.drawCenteredString(this.font, this.title.func_150254_d(), this.width / 2, 15, 16777215);
|
||||
super.render(p_render_1_, p_render_2_, p_render_3_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void onClose() {
|
||||
+ // We need to consider 2 potential parent screens here:
|
||||
+ // 1. From the main menu, in which case display the main menu
|
||||
+ // 2. From the pause menu, in which case exit back to game
|
||||
+ this.minecraft.func_147108_a(this.field_146441_g instanceof IngameMenuScreen ? null : this.field_146441_g);
|
||||
+ }
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
if (this.field_78776_a.field_71439_g.func_223729_a(this.field_78776_a.field_71441_e, p_187103_1_, this.field_78779_k)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -103,7 +104,7 @@
|
||||
@@ -103,12 +104,11 @@
|
||||
Block block = blockstate.func_177230_c();
|
||||
if ((block instanceof CommandBlockBlock || block instanceof StructureBlock || block instanceof JigsawBlock) && !this.field_78776_a.field_71439_g.func_195070_dx()) {
|
||||
return false;
|
||||
@@ -16,8 +16,14 @@
|
||||
+ } else if (blockstate.isAir(world, p_187103_1_)) {
|
||||
return false;
|
||||
} else {
|
||||
block.func_176208_a(world, p_187103_1_, blockstate, this.field_78776_a.field_71439_g);
|
||||
@@ -129,21 +130,25 @@
|
||||
- block.func_176208_a(world, p_187103_1_, blockstate, this.field_78776_a.field_71439_g);
|
||||
IFluidState ifluidstate = world.func_204610_c(p_187103_1_);
|
||||
- boolean flag = world.func_180501_a(p_187103_1_, ifluidstate.func_206883_i(), 11);
|
||||
+ boolean flag = blockstate.removedByPlayer(world, p_187103_1_, field_78776_a.field_71439_g, false, ifluidstate);
|
||||
if (flag) {
|
||||
block.func_176206_d(world, p_187103_1_, blockstate);
|
||||
}
|
||||
@@ -129,21 +129,25 @@
|
||||
BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_);
|
||||
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, blockstate, 1.0F);
|
||||
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180511_1_, p_180511_2_);
|
||||
@@ -44,7 +50,7 @@
|
||||
if (flag && blockstate1.func_185903_a(this.field_78776_a.field_71439_g, this.field_78776_a.field_71439_g.field_70170_p, p_180511_1_) >= 1.0F) {
|
||||
this.func_187103_a(p_180511_1_);
|
||||
} else {
|
||||
@@ -183,22 +188,24 @@
|
||||
@@ -183,22 +187,24 @@
|
||||
BlockState blockstate1 = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_);
|
||||
this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180512_1_, blockstate1, 1.0F);
|
||||
this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
|
||||
@@ -71,7 +77,7 @@
|
||||
if (this.field_78770_f >= 1.0F) {
|
||||
this.field_78778_j = false;
|
||||
this.func_225324_a(CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK, p_180512_1_, p_180512_2_);
|
||||
@@ -217,7 +224,8 @@
|
||||
@@ -217,7 +223,8 @@
|
||||
}
|
||||
|
||||
public float func_78757_d() {
|
||||
@@ -81,7 +87,7 @@
|
||||
}
|
||||
|
||||
public void func_78765_e() {
|
||||
@@ -234,7 +242,7 @@
|
||||
@@ -234,7 +241,7 @@
|
||||
ItemStack itemstack = this.field_78776_a.field_71439_g.func_184614_ca();
|
||||
boolean flag = this.field_85183_f.func_190926_b() && itemstack.func_190926_b();
|
||||
if (!this.field_85183_f.func_190926_b() && !itemstack.func_190926_b()) {
|
||||
@@ -90,7 +96,7 @@
|
||||
}
|
||||
|
||||
return p_178893_1_.equals(this.field_178895_c) && flag;
|
||||
@@ -256,13 +264,24 @@
|
||||
@@ -256,13 +263,27 @@
|
||||
return ActionResultType.FAIL;
|
||||
} else {
|
||||
ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_);
|
||||
@@ -108,7 +114,10 @@
|
||||
+ ItemUseContext itemusecontext = new ItemUseContext(p_217292_1_, p_217292_3_, p_217292_4_);
|
||||
+ if (event.getUseItem() != net.minecraftforge.eventbus.api.Event.Result.DENY) {
|
||||
+ ActionResultType result = itemstack.onItemUseFirst(itemusecontext);
|
||||
+ if (result != ActionResultType.PASS) return result;
|
||||
+ if (result != ActionResultType.PASS) {
|
||||
+ this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
|
||||
+ return result;
|
||||
+ }
|
||||
+ }
|
||||
+ boolean flag = !p_217292_1_.func_184614_ca().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_) || !p_217292_1_.func_184592_cb().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_);
|
||||
boolean flag1 = p_217292_1_.func_226563_dT_() && flag;
|
||||
@@ -117,7 +126,7 @@
|
||||
ActionResultType actionresulttype = p_217292_2_.func_180495_p(blockpos).func_227031_a_(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_);
|
||||
if (actionresulttype.func_226246_a_()) {
|
||||
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
|
||||
@@ -271,8 +290,8 @@
|
||||
@@ -271,8 +292,8 @@
|
||||
}
|
||||
|
||||
this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
|
||||
@@ -127,7 +136,7 @@
|
||||
ActionResultType actionresulttype1;
|
||||
if (this.field_78779_k.func_77145_d()) {
|
||||
int i = itemstack.func_190916_E();
|
||||
@@ -300,11 +319,14 @@
|
||||
@@ -300,11 +321,14 @@
|
||||
if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) {
|
||||
return ActionResultType.PASS;
|
||||
} else {
|
||||
@@ -142,7 +151,7 @@
|
||||
}
|
||||
|
||||
return actionresult.func_188397_a();
|
||||
@@ -329,6 +351,9 @@
|
||||
@@ -329,6 +353,9 @@
|
||||
public ActionResultType func_187097_a(PlayerEntity p_187097_1_, Entity p_187097_2_, Hand p_187097_3_) {
|
||||
this.func_78750_j();
|
||||
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187097_2_, p_187097_3_));
|
||||
@@ -152,7 +161,7 @@
|
||||
return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_);
|
||||
}
|
||||
|
||||
@@ -336,6 +361,9 @@
|
||||
@@ -336,6 +363,9 @@
|
||||
this.func_78750_j();
|
||||
Vec3d vec3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.func_226277_ct_(), p_187102_2_.func_226278_cu_(), p_187102_2_.func_226281_cx_());
|
||||
this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vec3d));
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
p_228800_4_.func_227890_a_(p_228800_5_, p_228800_6_, new float[]{p_228800_7_, p_228800_8_, p_228800_9_, p_228800_10_}, f, f1, f2, new int[]{p_228800_11_, p_228800_12_, p_228800_13_, p_228800_14_}, p_228800_15_, true);
|
||||
}
|
||||
@@ -208,7 +230,11 @@
|
||||
@@ -208,17 +230,21 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -107,3 +107,15 @@
|
||||
Random random = new Random();
|
||||
long i = 42L;
|
||||
|
||||
for(Direction direction : Direction.values()) {
|
||||
random.setSeed(42L);
|
||||
- func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.func_200117_a(p_228804_3_, direction, random), p_228804_8_, p_228804_9_);
|
||||
+ func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.getQuads(p_228804_3_, direction, random, modelData), p_228804_8_, p_228804_9_);
|
||||
}
|
||||
|
||||
random.setSeed(42L);
|
||||
- func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.func_200117_a(p_228804_3_, (Direction)null, random), p_228804_8_, p_228804_9_);
|
||||
+ func_228803_a_(p_228804_1_, p_228804_2_, p_228804_5_, p_228804_6_, p_228804_7_, p_228804_4_.getQuads(p_228804_3_, (Direction)null, random, modelData), p_228804_8_, p_228804_9_);
|
||||
}
|
||||
|
||||
private static void func_228803_a_(MatrixStack.Entry p_228803_0_, IVertexBuilder p_228803_1_, float p_228803_2_, float p_228803_3_, float p_228803_4_, List<BakedQuad> p_228803_5_, int p_228803_6_, int p_228803_7_) {
|
||||
@@ -1,5 +1,14 @@
|
||||
--- a/net/minecraft/client/renderer/BlockRendererDispatcher.java
|
||||
+++ b/net/minecraft/client/renderer/BlockRendererDispatcher.java
|
||||
@@ -32,7 +32,7 @@
|
||||
public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) {
|
||||
this.field_175028_a = p_i46577_1_;
|
||||
this.field_228790_e_ = p_i46577_2_;
|
||||
- this.field_175027_c = new BlockModelRenderer(this.field_228790_e_);
|
||||
+ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(this.field_228790_e_);
|
||||
this.field_175025_e = new FluidBlockRenderer();
|
||||
}
|
||||
|
||||
@@ -40,18 +40,26 @@
|
||||
return this.field_175028_a;
|
||||
}
|
||||
@@ -41,7 +50,7 @@
|
||||
BlockRenderType blockrendertype = p_228791_1_.func_185901_i();
|
||||
if (blockrendertype != BlockRenderType.INVISIBLE) {
|
||||
switch(blockrendertype) {
|
||||
@@ -89,7 +101,7 @@
|
||||
@@ -89,10 +101,11 @@
|
||||
float f = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f1 = (float)(i >> 8 & 255) / 255.0F;
|
||||
float f2 = (float)(i & 255) / 255.0F;
|
||||
@@ -49,8 +58,13 @@
|
||||
+ this.field_175027_c.renderModel(p_228791_2_.func_227866_c_(), p_228791_3_.getBuffer(RenderTypeLookup.func_228394_b_(p_228791_1_)), p_228791_1_, ibakedmodel, f, f1, f2, p_228791_4_, p_228791_5_, modelData);
|
||||
break;
|
||||
case ENTITYBLOCK_ANIMATED:
|
||||
ItemStackTileEntityRenderer.field_147719_a.func_228364_a_(new ItemStack(p_228791_1_.func_177230_c()), p_228791_2_, p_228791_3_, p_228791_4_, p_228791_5_);
|
||||
@@ -101,4 +113,9 @@
|
||||
- ItemStackTileEntityRenderer.field_147719_a.func_228364_a_(new ItemStack(p_228791_1_.func_177230_c()), p_228791_2_, p_228791_3_, p_228791_4_, p_228791_5_);
|
||||
+ ItemStack stack = new ItemStack(p_228791_1_.func_177230_c());
|
||||
+ stack.func_77973_b().getItemStackTileEntityRenderer().func_228364_a_(stack, p_228791_2_, p_228791_3_, p_228791_4_, p_228791_5_);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,4 +114,9 @@
|
||||
public void func_195410_a(IResourceManager p_195410_1_) {
|
||||
this.field_175025_e.func_178268_a();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/BufferBuilder.java
|
||||
+++ b/net/minecraft/client/renderer/BufferBuilder.java
|
||||
@@ -121,7 +121,6 @@
|
||||
@@ -122,7 +122,6 @@
|
||||
|
||||
bitset.set(l);
|
||||
}
|
||||
@@ -8,16 +8,25 @@
|
||||
}
|
||||
|
||||
private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) {
|
||||
@@ -364,4 +363,14 @@
|
||||
@@ -298,6 +297,7 @@
|
||||
}
|
||||
|
||||
ByteBuffer bytebuffer = this.field_179001_a.slice();
|
||||
+ bytebuffer.order(this.field_179001_a.order()); // FORGE: Fix incorrect byte order
|
||||
((Buffer)this.field_179001_a).clear();
|
||||
return Pair.of(bufferbuilder$drawstate, bytebuffer);
|
||||
}
|
||||
@@ -365,4 +365,15 @@
|
||||
this.field_179018_e = p_i225907_2_;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public void putBulkData(ByteBuffer buffer) {
|
||||
+ func_181670_b(buffer.limit() + this.field_179011_q.func_177338_f());
|
||||
+ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f());
|
||||
+ ((Buffer)this.field_179001_a).position(this.field_178997_d * this.field_179011_q.func_177338_f());
|
||||
+ this.field_179001_a.put(buffer);
|
||||
+ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f();
|
||||
+ this.field_227824_l_ += buffer.limit();
|
||||
+ }
|
||||
+
|
||||
+ // Forge start
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
if (flag) {
|
||||
float f5 = hand == Hand.MAIN_HAND ? f : 0.0F;
|
||||
float f2 = 1.0F - MathHelper.func_219799_g(p_228396_1_, this.field_187470_g, this.field_187469_f);
|
||||
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.MAIN_HAND, p_228396_2_, p_228396_3_, p_228396_5_, p_228396_1_, f1, f3, f5, this.field_187467_d))
|
||||
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.MAIN_HAND, p_228396_2_, p_228396_3_, p_228396_5_, p_228396_1_, f1, f5, f2, this.field_187467_d))
|
||||
this.func_228405_a_(p_228396_4_, p_228396_1_, f1, Hand.MAIN_HAND, f5, this.field_187467_d, f2, p_228396_2_, p_228396_3_, p_228396_5_);
|
||||
}
|
||||
|
||||
if (flag1) {
|
||||
float f6 = hand == Hand.OFF_HAND ? f : 0.0F;
|
||||
float f7 = 1.0F - MathHelper.func_219799_g(p_228396_1_, this.field_187472_i, this.field_187471_h);
|
||||
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.OFF_HAND, p_228396_2_, p_228396_3_, p_228396_5_, p_228396_1_, f1, f4, f6, this.field_187468_e))
|
||||
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.OFF_HAND, p_228396_2_, p_228396_3_, p_228396_5_, p_228396_1_, f1, f6, f7, this.field_187468_e))
|
||||
this.func_228405_a_(p_228396_4_, p_228396_1_, f1, Hand.OFF_HAND, f6, this.field_187468_e, f7, p_228396_2_, p_228396_3_, p_228396_5_);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,19 +20,19 @@
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, f16, f20, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
|
||||
if (p_228796_4_.func_205586_a(p_228796_1_, p_228796_2_.func_177984_a())) {
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, f13, f17, j);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, f16, f20, j);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
|
||||
+ this.vertex(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,27 +44,28 @@
|
||||
- this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, f34, f37, i1);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, f35, f37, i1);
|
||||
- this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, f35, f39, i1);
|
||||
+ this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f34, f39, i1);
|
||||
+ this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, alpha, f34, f37, i1);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, alpha, f35, f37, i1);
|
||||
+ this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f35, f39, i1);
|
||||
+ this.vertex(p_228796_3_, d0, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f34, f39, i1);
|
||||
+ this.vertex(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, alpha, f34, f37, i1);
|
||||
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, alpha, f35, f37, i1);
|
||||
+ this.vertex(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, alpha, f35, f39, i1);
|
||||
flag7 = true;
|
||||
}
|
||||
|
||||
@@ -222,10 +223,10 @@
|
||||
@@ -222,10 +223,9 @@
|
||||
flag7 = true;
|
||||
BlockPos blockpos = p_228796_2_.func_177972_a(direction);
|
||||
TextureAtlasSprite textureatlassprite2 = atextureatlassprite[1];
|
||||
- if (!flag) {
|
||||
+ if (atextureatlassprite[2] != null) {
|
||||
Block block = p_228796_1_.func_180495_p(blockpos).func_177230_c();
|
||||
if (block == Blocks.field_150359_w || block instanceof StainedGlassBlock) {
|
||||
- Block block = p_228796_1_.func_180495_p(blockpos).func_177230_c();
|
||||
- if (block == Blocks.field_150359_w || block instanceof StainedGlassBlock) {
|
||||
- textureatlassprite2 = this.field_187501_d;
|
||||
+ if (atextureatlassprite[2] != null) {
|
||||
+ if (p_228796_1_.func_180495_p(blockpos).shouldDisplayFluidOverlay(p_228796_1_, blockpos, p_228796_4_)) {
|
||||
+ textureatlassprite2 = atextureatlassprite[2];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,15 +240,15 @@
|
||||
@@ -239,15 +239,15 @@
|
||||
float f31 = 1.0F * f30 * f;
|
||||
float f32 = 1.0F * f30 * f1;
|
||||
float f33 = 1.0F * f30 * f2;
|
||||
@@ -77,29 +78,29 @@
|
||||
- this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, f49, f29, k);
|
||||
- this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, f49, f28, k);
|
||||
- this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, f48, f50, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
|
||||
+ this.vertex(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
|
||||
+ this.vertex(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
|
||||
+ this.vertex(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
|
||||
+ this.vertex(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
|
||||
+ if (textureatlassprite2 != atextureatlassprite[2]) {
|
||||
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
|
||||
+ this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
|
||||
+ this.vertex(p_228796_3_, d3, d1 + (double)f12, d4, f31, f32, f33, alpha, f48, f29, k);
|
||||
+ this.vertex(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, alpha, f49, f29, k);
|
||||
+ this.vertex(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, alpha, f49, f28, k);
|
||||
+ this.vertex(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, alpha, f48, f50, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,10 +257,15 @@
|
||||
@@ -256,10 +256,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Deprecated
|
||||
private void func_228797_a_(IVertexBuilder p_228797_1_, double p_228797_2_, double p_228797_4_, double p_228797_6_, float p_228797_8_, float p_228797_9_, float p_228797_10_, float p_228797_11_, float p_228797_12_, int p_228797_13_) {
|
||||
- p_228797_1_.func_225582_a_(p_228797_2_, p_228797_4_, p_228797_6_).func_227885_a_(p_228797_8_, p_228797_9_, p_228797_10_, 1.0F).func_225583_a_(p_228797_11_, p_228797_12_).func_227886_a_(p_228797_13_).func_225584_a_(0.0F, 1.0F, 0.0F).func_181675_d();
|
||||
+ func_228797_a_(p_228797_1_, p_228797_2_, p_228797_4_, p_228797_6_, p_228797_8_, p_228797_9_, p_228797_10_, 1.0F, p_228797_11_, p_228797_12_, p_228797_13_);
|
||||
+ vertex(p_228797_1_, p_228797_2_, p_228797_4_, p_228797_6_, p_228797_8_, p_228797_9_, p_228797_10_, 1.0F, p_228797_11_, p_228797_12_, p_228797_13_);
|
||||
}
|
||||
|
||||
+ private void func_228797_a_(IVertexBuilder p_228797_1_, double p_228797_2_, double p_228797_4_, double p_228797_6_, float p_228797_8_, float p_228797_9_, float p_228797_10_, float alpha, float p_228797_11_, float p_228797_12_, int p_228797_13_) {
|
||||
+ private void vertex(IVertexBuilder p_228797_1_, double p_228797_2_, double p_228797_4_, double p_228797_6_, float p_228797_8_, float p_228797_9_, float p_228797_10_, float alpha, float p_228797_11_, float p_228797_12_, int p_228797_13_) {
|
||||
+ p_228797_1_.func_225582_a_(p_228797_2_, p_228797_4_, p_228797_6_).func_227885_a_(p_228797_8_, p_228797_9_, p_228797_10_, alpha).func_225583_a_(p_228797_11_, p_228797_12_).func_227886_a_(p_228797_13_).func_225584_a_(0.0F, 1.0F, 0.0F).func_181675_d();
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
p_228378_4_.func_227863_a_(Vector3f.field_229181_d_.func_229187_a_(activerenderinfo.func_216778_f() + 180.0F));
|
||||
this.field_78531_r.field_71438_f.func_228426_a_(p_228378_4_, p_228378_1_, p_228378_2_, flag, activerenderinfo, this, this.field_78513_d, matrix4f);
|
||||
+ this.field_78531_r.func_213239_aq().func_219895_b("forge_render_last");
|
||||
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(this.field_78531_r.field_71438_f, p_228378_4_, p_228378_2_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(this.field_78531_r.field_71438_f, p_228378_4_, p_228378_1_, matrix4f, p_228378_2_);
|
||||
this.field_78531_r.func_213239_aq().func_219895_b("hand");
|
||||
if (this.field_175074_C) {
|
||||
RenderSystem.clear(256, Minecraft.field_142025_a);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/client/renderer/RenderState.java
|
||||
+++ b/net/minecraft/client/renderer/RenderState.java
|
||||
@@ -360,7 +360,7 @@
|
||||
private final OptionalDouble field_228587_Q_;
|
||||
|
||||
public LineState(OptionalDouble p_i225982_1_) {
|
||||
- super("alpha", () -> {
|
||||
+ super("line_width", () -> { // FORGE: fix MC-167447
|
||||
if (!Objects.equals(p_i225982_1_, OptionalDouble.of(1.0D))) {
|
||||
if (p_i225982_1_.isPresent()) {
|
||||
RenderSystem.lineWidth((float)p_i225982_1_.getAsDouble());
|
||||
@@ -85,7 +85,38 @@
|
||||
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.field_223229_c_) {
|
||||
this.func_228444_b_(p_228424_1_);
|
||||
} else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
|
||||
@@ -2283,8 +2298,8 @@
|
||||
@@ -1977,7 +1992,12 @@
|
||||
this.field_175008_n.func_217628_a(p_215319_1_, p_215319_2_, p_215319_3_, p_215319_4_);
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: use item aware function below
|
||||
public void func_184377_a(@Nullable SoundEvent p_184377_1_, BlockPos p_184377_2_) {
|
||||
+ this.playRecord(p_184377_1_, p_184377_2_, p_184377_1_ == null? null : MusicDiscItem.func_185074_a(p_184377_1_));
|
||||
+ }
|
||||
+
|
||||
+ public void playRecord(@Nullable SoundEvent p_184377_1_, BlockPos p_184377_2_, @Nullable MusicDiscItem musicDiscItem) {
|
||||
ISound isound = this.field_147593_P.get(p_184377_2_);
|
||||
if (isound != null) {
|
||||
this.field_72777_q.func_147118_V().func_147683_b(isound);
|
||||
@@ -1985,7 +2005,7 @@
|
||||
}
|
||||
|
||||
if (p_184377_1_ != null) {
|
||||
- MusicDiscItem musicdiscitem = MusicDiscItem.func_185074_a(p_184377_1_);
|
||||
+ MusicDiscItem musicdiscitem = musicDiscItem;
|
||||
if (musicdiscitem != null) {
|
||||
this.field_72777_q.field_71456_v.func_73833_a(musicdiscitem.func_200299_h().func_150254_d());
|
||||
}
|
||||
@@ -2133,7 +2153,7 @@
|
||||
break;
|
||||
case 1010:
|
||||
if (Item.func_150899_d(p_180439_4_) instanceof MusicDiscItem) {
|
||||
- this.func_184377_a(((MusicDiscItem)Item.func_150899_d(p_180439_4_)).func_185075_h(), p_180439_3_);
|
||||
+ this.playRecord(((MusicDiscItem)Item.func_150899_d(p_180439_4_)).func_185075_h(), p_180439_3_, (MusicDiscItem) Item.func_150899_d(p_180439_4_));
|
||||
} else {
|
||||
this.func_184377_a((SoundEvent)null, p_180439_3_);
|
||||
}
|
||||
@@ -2283,8 +2303,8 @@
|
||||
break;
|
||||
case 2001:
|
||||
BlockState blockstate = Block.func_196257_b(p_180439_4_);
|
||||
@@ -96,7 +127,7 @@
|
||||
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
|
||||
}
|
||||
|
||||
@@ -2432,7 +2447,7 @@
|
||||
@@ -2432,7 +2452,7 @@
|
||||
} else {
|
||||
int i = p_228420_0_.func_226658_a_(LightType.SKY, p_228420_2_);
|
||||
int j = p_228420_0_.func_226658_a_(LightType.BLOCK, p_228420_2_);
|
||||
@@ -105,7 +136,7 @@
|
||||
if (j < k) {
|
||||
j = k;
|
||||
}
|
||||
@@ -2445,6 +2460,11 @@
|
||||
@@ -2445,6 +2465,11 @@
|
||||
return this.field_175015_z;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
public void func_225623_a_(T p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
|
||||
- if (this.func_177070_b(p_225623_1_)) {
|
||||
- this.func_225629_a_(p_225623_1_, p_225623_1_.func_145748_c_().func_150254_d(), p_225623_4_, p_225623_5_, p_225623_6_);
|
||||
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_,p_225623_1_.func_145748_c_().func_150254_d(), p_225623_4_, p_225623_5_);
|
||||
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_, p_225623_1_.func_145748_c_().func_150254_d(), this, p_225623_4_, p_225623_5_, p_225623_6_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(renderNameplateEvent);
|
||||
+ if (renderNameplateEvent.getResult() != net.minecraftforge.eventbus.api.Event.Result.DENY && (renderNameplateEvent.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || this.func_177070_b(p_225623_1_))) {
|
||||
+ this.func_225629_a_(p_225623_1_, renderNameplateEvent.getContent(), p_225623_4_, p_225623_5_, p_225623_6_);
|
||||
|
||||
@@ -78,3 +78,11 @@
|
||||
public boolean func_178300_b(String p_178300_1_) {
|
||||
return !MissingTextureSprite.func_195675_b().equals(this.func_228816_c_(p_178300_1_).func_229313_b_());
|
||||
}
|
||||
@@ -373,5 +396,7 @@
|
||||
public boolean func_230178_a_() {
|
||||
return this == SIDE;
|
||||
}
|
||||
+
|
||||
+ public String getSerializedName() { return field_230177_c_; }
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
this.field_217848_D.addAll(p_209593_2_.func_187965_e());
|
||||
}
|
||||
|
||||
+ // Same as func_217843_a but without restricting to MRL's
|
||||
+ // Same as loadTopModel but without restricting to MRL's
|
||||
+ private void addModelToCache(ResourceLocation p_217843_1_) {
|
||||
+ IUnbakedModel iunbakedmodel = this.func_209597_a(p_217843_1_);
|
||||
+ this.field_217849_F.put(p_217843_1_, iunbakedmodel);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
public AtlasTexture func_229356_a_(ResourceLocation p_229356_1_) {
|
||||
+ if (this.field_229352_b_ == null) throw new RuntimeException("func_229356_a_ called too early!");
|
||||
+ if (this.field_229352_b_ == null) throw new RuntimeException("getAtlasTexture called too early!");
|
||||
return this.field_229352_b_.func_229152_a_(p_229356_1_);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/client/renderer/model/VariantList.java
|
||||
+++ b/net/minecraft/client/renderer/model/VariantList.java
|
||||
@@ -64,7 +64,7 @@
|
||||
WeightedBakedModel.Builder weightedbakedmodel$builder = new WeightedBakedModel.Builder();
|
||||
|
||||
for(Variant variant : this.func_188114_a()) {
|
||||
- IBakedModel ibakedmodel = p_225613_1_.func_217845_a(variant.func_188046_a(), variant);
|
||||
+ IBakedModel ibakedmodel = p_225613_1_.getBakedModel(variant.func_188046_a(), variant, p_225613_2_);
|
||||
weightedbakedmodel$builder.func_177677_a(ibakedmodel, variant.func_188047_d());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/texture/NativeImage.java
|
||||
+++ b/net/minecraft/client/renderer/texture/NativeImage.java
|
||||
@@ -179,7 +179,7 @@
|
||||
@@ -180,7 +180,7 @@
|
||||
public int func_195709_a(int p_195709_1_, int p_195709_2_) {
|
||||
if (this.field_211680_b != NativeImage.PixelFormat.RGBA) {
|
||||
throw new IllegalArgumentException(String.format("getPixelRGBA only works on RGBA images; have %s", this.field_211680_b));
|
||||
@@ -9,7 +9,7 @@
|
||||
this.func_195696_g();
|
||||
long i = (long)((p_195709_1_ + p_195709_2_ * this.field_195719_a) * 4);
|
||||
return MemoryUtil.memGetInt(this.field_195722_d + i);
|
||||
@@ -191,7 +191,7 @@
|
||||
@@ -192,7 +192,7 @@
|
||||
public void func_195700_a(int p_195700_1_, int p_195700_2_, int p_195700_3_) {
|
||||
if (this.field_211680_b != NativeImage.PixelFormat.RGBA) {
|
||||
throw new IllegalArgumentException(String.format("getPixelRGBA only works on RGBA images; have %s", this.field_211680_b));
|
||||
@@ -18,7 +18,7 @@
|
||||
this.func_195696_g();
|
||||
long i = (long)((p_195700_1_ + p_195700_2_ * this.field_195719_a) * 4);
|
||||
MemoryUtil.memPutInt(this.field_195722_d + i, p_195700_3_);
|
||||
@@ -203,7 +203,7 @@
|
||||
@@ -204,7 +204,7 @@
|
||||
public byte func_211675_e(int p_211675_1_, int p_211675_2_) {
|
||||
if (!this.field_211680_b.func_211653_r()) {
|
||||
throw new IllegalArgumentException(String.format("no luminance or alpha in %s", this.field_211680_b));
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
--- a/net/minecraft/client/shader/Framebuffer.java
|
||||
+++ b/net/minecraft/client/shader/Framebuffer.java
|
||||
@@ -100,8 +100,14 @@
|
||||
GlStateManager.func_227645_a_(FramebufferConstants.field_227592_a_, FramebufferConstants.field_227594_c_, 3553, this.field_147617_g, 0);
|
||||
if (this.field_147619_e) {
|
||||
GlStateManager.func_227730_i_(FramebufferConstants.field_227593_b_, this.field_147624_h);
|
||||
+ if (!stencilEnabled) {
|
||||
GlStateManager.func_227678_b_(FramebufferConstants.field_227593_b_, 33190, this.field_147622_a, this.field_147620_b);
|
||||
GlStateManager.func_227693_c_(FramebufferConstants.field_227592_a_, FramebufferConstants.field_227595_d_, FramebufferConstants.field_227593_b_, this.field_147624_h);
|
||||
+ } else {
|
||||
+ GlStateManager.func_227678_b_(FramebufferConstants.field_227593_b_, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b);
|
||||
+ GlStateManager.func_227693_c_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, FramebufferConstants.field_227593_b_, this.field_147624_h);
|
||||
+ GlStateManager.func_227693_c_(FramebufferConstants.field_227592_a_, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, FramebufferConstants.field_227593_b_, this.field_147624_h);
|
||||
+ }
|
||||
}
|
||||
|
||||
this.func_147611_b();
|
||||
@@ -254,4 +260,29 @@
|
||||
GlStateManager.func_227658_a_(i, p_216493_1_);
|
||||
this.func_147609_e();
|
||||
}
|
||||
+
|
||||
+ /*================================ FORGE START ================================================*/
|
||||
+ private boolean stencilEnabled = false;
|
||||
+ /**
|
||||
+ * Attempts to enable 8 bits of stencil buffer on this FrameBuffer.
|
||||
+ * Modders must call this directly to set things up.
|
||||
+ * This is to prevent the default cause where graphics cards do not support stencil bits.
|
||||
+ * <b>Make sure to call this on the main render thread!</b>
|
||||
+ */
|
||||
+ public void enableStencil()
|
||||
+ {
|
||||
+ if(stencilEnabled) return;
|
||||
+ stencilEnabled = true;
|
||||
+ this.func_216491_a(field_147621_c, field_147618_d, net.minecraft.client.Minecraft.field_142025_a);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns wither or not this FBO has been successfully initialized with stencil bits.
|
||||
+ * If not, and a modder wishes it to be, they must call enableStencil.
|
||||
+ */
|
||||
+ public boolean isStencilEnabled()
|
||||
+ {
|
||||
+ return this.stencilEnabled;
|
||||
+ }
|
||||
+ /*================================ FORGE END ================================================*/
|
||||
}
|
||||
@@ -9,7 +9,15 @@
|
||||
}
|
||||
|
||||
public Collection<Path> func_200389_a() {
|
||||
@@ -53,6 +53,10 @@
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
for(IDataProvider idataprovider : this.field_200396_d) {
|
||||
field_200393_a.info("Starting provider: {}", (Object)idataprovider.func_200397_b());
|
||||
+ net.minecraftforge.fml.StartupMessageManager.addModMessage("Generating: " + idataprovider.func_200397_b());
|
||||
stopwatch1.start();
|
||||
idataprovider.func_200398_a(directorycache);
|
||||
stopwatch1.stop();
|
||||
@@ -53,6 +54,10 @@
|
||||
this.field_200396_d.add(p_200390_1_);
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,17 @@
|
||||
}
|
||||
|
||||
protected void func_213333_a(DamageSource p_213333_1_, int p_213333_2_, boolean p_213333_3_) {
|
||||
@@ -1161,6 +1186,9 @@
|
||||
@@ -1148,7 +1173,8 @@
|
||||
ResourceLocation resourcelocation = this.func_213346_cF();
|
||||
LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(resourcelocation);
|
||||
LootContext.Builder lootcontext$builder = this.func_213363_a(p_213354_2_, p_213354_1_);
|
||||
- loottable.func_216120_b(lootcontext$builder.func_216022_a(LootParameterSets.field_216263_d), this::func_199701_a_);
|
||||
+ LootContext ctx = lootcontext$builder.func_216022_a(LootParameterSets.field_216263_d);
|
||||
+ loottable.func_216113_a(ctx).forEach(this::func_199701_a_);
|
||||
}
|
||||
|
||||
protected LootContext.Builder func_213363_a(boolean p_213363_1_, DamageSource p_213363_2_) {
|
||||
@@ -1161,6 +1187,9 @@
|
||||
}
|
||||
|
||||
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
|
||||
@@ -215,7 +225,7 @@
|
||||
if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) {
|
||||
this.field_70160_al = true;
|
||||
Vec3d vec3d = this.func_213322_ci();
|
||||
@@ -1196,12 +1224,7 @@
|
||||
@@ -1196,12 +1225,7 @@
|
||||
return false;
|
||||
} else {
|
||||
BlockState blockstate = this.func_213339_cH();
|
||||
@@ -229,7 +239,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1225,6 +1248,11 @@
|
||||
@@ -1225,6 +1249,11 @@
|
||||
}
|
||||
|
||||
public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) {
|
||||
@@ -241,7 +251,7 @@
|
||||
boolean flag = super.func_225503_b_(p_225503_1_, p_225503_2_);
|
||||
int i = this.func_225508_e_(p_225503_1_, p_225503_2_);
|
||||
if (i > 0) {
|
||||
@@ -1248,9 +1276,10 @@
|
||||
@@ -1248,9 +1277,10 @@
|
||||
int i = MathHelper.func_76128_c(this.func_226277_ct_());
|
||||
int j = MathHelper.func_76128_c(this.func_226278_cu_() - (double)0.2F);
|
||||
int k = MathHelper.func_76128_c(this.func_226281_cx_());
|
||||
@@ -255,7 +265,7 @@
|
||||
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
|
||||
}
|
||||
|
||||
@@ -1319,6 +1348,8 @@
|
||||
@@ -1319,6 +1349,8 @@
|
||||
|
||||
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
|
||||
if (!this.func_180431_b(p_70665_1_)) {
|
||||
@@ -264,7 +274,7 @@
|
||||
p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_);
|
||||
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
|
||||
float f2 = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F);
|
||||
@@ -1328,10 +1359,11 @@
|
||||
@@ -1328,10 +1360,11 @@
|
||||
((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f * 10.0F));
|
||||
}
|
||||
|
||||
@@ -277,7 +287,7 @@
|
||||
this.func_110149_m(this.func_110139_bj() - f2);
|
||||
}
|
||||
}
|
||||
@@ -1385,6 +1417,8 @@
|
||||
@@ -1385,6 +1418,8 @@
|
||||
}
|
||||
|
||||
public void func_226292_a_(Hand p_226292_1_, boolean p_226292_2_) {
|
||||
@@ -286,7 +296,7 @@
|
||||
if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) {
|
||||
this.field_110158_av = -1;
|
||||
this.field_82175_bq = true;
|
||||
@@ -1771,15 +1805,16 @@
|
||||
@@ -1771,15 +1806,16 @@
|
||||
}
|
||||
|
||||
this.field_70160_al = true;
|
||||
@@ -305,7 +315,7 @@
|
||||
}
|
||||
|
||||
protected float func_189749_co() {
|
||||
@@ -1789,11 +1824,15 @@
|
||||
@@ -1789,11 +1825,15 @@
|
||||
public void func_213352_e(Vec3d p_213352_1_) {
|
||||
if (this.func_70613_aW() || this.func_184186_bw()) {
|
||||
double d0 = 0.08D;
|
||||
@@ -322,7 +332,7 @@
|
||||
|
||||
if (!this.func_70090_H() || this instanceof PlayerEntity && ((PlayerEntity)this).field_71075_bZ.field_75100_b) {
|
||||
if (!this.func_180799_ab() || this instanceof PlayerEntity && ((PlayerEntity)this).field_71075_bZ.field_75100_b) {
|
||||
@@ -1842,7 +1881,7 @@
|
||||
@@ -1842,7 +1882,7 @@
|
||||
}
|
||||
} else {
|
||||
BlockPos blockpos = this.func_226270_aj_();
|
||||
@@ -331,7 +341,7 @@
|
||||
float f7 = this.field_70122_E ? f5 * 0.91F : 0.91F;
|
||||
this.func_213309_a(this.func_213335_r(f5), p_213352_1_);
|
||||
this.func_213317_d(this.func_213362_f(this.func_213322_ci()));
|
||||
@@ -1904,6 +1943,7 @@
|
||||
@@ -1904,6 +1944,7 @@
|
||||
f = 0.96F;
|
||||
}
|
||||
|
||||
@@ -339,7 +349,7 @@
|
||||
this.func_213309_a(f1, p_213352_1_);
|
||||
this.func_213315_a(MoverType.SELF, this.func_213322_ci());
|
||||
Vec3d vec3d1 = this.func_213322_ci();
|
||||
@@ -1979,6 +2019,7 @@
|
||||
@@ -1979,6 +2020,7 @@
|
||||
}
|
||||
|
||||
public void func_70071_h_() {
|
||||
@@ -347,7 +357,7 @@
|
||||
super.func_70071_h_();
|
||||
this.func_184608_ct();
|
||||
this.func_205014_p();
|
||||
@@ -2022,7 +2063,9 @@
|
||||
@@ -2022,7 +2064,9 @@
|
||||
|
||||
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
|
||||
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
|
||||
@@ -357,7 +367,7 @@
|
||||
if (!itemstack.func_190926_b()) {
|
||||
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(equipmentslottype));
|
||||
}
|
||||
@@ -2474,13 +2517,22 @@
|
||||
@@ -2474,13 +2518,22 @@
|
||||
|
||||
private void func_184608_ct() {
|
||||
if (this.func_184587_cr()) {
|
||||
@@ -382,7 +392,7 @@
|
||||
this.func_71036_o();
|
||||
}
|
||||
} else {
|
||||
@@ -2522,8 +2574,10 @@
|
||||
@@ -2522,8 +2575,10 @@
|
||||
public void func_184598_c(Hand p_184598_1_) {
|
||||
ItemStack itemstack = this.func_184586_b(p_184598_1_);
|
||||
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
|
||||
@@ -394,7 +404,7 @@
|
||||
if (!this.field_70170_p.field_72995_K) {
|
||||
this.func_204802_c(1, true);
|
||||
this.func_204802_c(2, p_184598_1_ == Hand.OFF_HAND);
|
||||
@@ -2583,6 +2637,9 @@
|
||||
@@ -2583,6 +2638,9 @@
|
||||
vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
|
||||
vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
|
||||
vec3d1 = vec3d1.func_72441_c(this.func_226277_ct_(), this.func_226280_cw_(), this.func_226281_cx_());
|
||||
@@ -404,7 +414,7 @@
|
||||
this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c);
|
||||
}
|
||||
|
||||
@@ -2594,7 +2651,9 @@
|
||||
@@ -2594,7 +2652,9 @@
|
||||
} else {
|
||||
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
|
||||
this.func_226293_b_(this.field_184627_bm, 16);
|
||||
@@ -415,7 +425,7 @@
|
||||
this.func_184602_cy();
|
||||
}
|
||||
|
||||
@@ -2615,7 +2674,11 @@
|
||||
@@ -2615,7 +2675,11 @@
|
||||
|
||||
public void func_184597_cx() {
|
||||
if (!this.field_184627_bm.func_190926_b()) {
|
||||
@@ -427,7 +437,7 @@
|
||||
if (this.field_184627_bm.func_222122_m()) {
|
||||
this.func_184608_ct();
|
||||
}
|
||||
@@ -2772,16 +2835,16 @@
|
||||
@@ -2772,16 +2836,16 @@
|
||||
|
||||
private boolean func_213359_p() {
|
||||
return this.func_213374_dv().map((p_213347_1_) -> {
|
||||
@@ -448,7 +458,7 @@
|
||||
BlockPos blockpos = p_213368_1_.func_177984_a();
|
||||
return new Vec3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D);
|
||||
});
|
||||
@@ -2797,7 +2860,9 @@
|
||||
@@ -2797,7 +2861,9 @@
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public Direction func_213376_dz() {
|
||||
BlockPos blockpos = this.func_213374_dv().orElse((BlockPos)null);
|
||||
@@ -459,7 +469,7 @@
|
||||
}
|
||||
|
||||
public boolean func_70094_T() {
|
||||
@@ -2866,4 +2931,58 @@
|
||||
@@ -2866,4 +2932,58 @@
|
||||
public void func_213334_d(Hand p_213334_1_) {
|
||||
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/entity/passive/BeeEntity.java
|
||||
+++ b/net/minecraft/entity/passive/BeeEntity.java
|
||||
@@ -438,7 +438,7 @@
|
||||
return false;
|
||||
} else {
|
||||
TileEntity tileentity = this.field_70170_p.func_175625_s(this.field_226369_bI_);
|
||||
- return tileentity != null && tileentity.func_200662_C() == TileEntityType.field_226985_G_;
|
||||
+ return tileentity instanceof BeehiveTileEntity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,6 +426,15 @@
|
||||
this.func_85039_t(p_195068_1_);
|
||||
this.field_71106_cc += (float)p_195068_1_ / (float)this.func_71050_bK();
|
||||
this.field_71067_cb = MathHelper.func_76125_a(this.field_71067_cb + p_195068_1_, 0, Integer.MAX_VALUE);
|
||||
@@ -1588,7 +1709,7 @@
|
||||
}
|
||||
|
||||
public void func_192024_a(ItemStack p_192024_1_, int p_192024_2_) {
|
||||
- this.field_71068_ca -= p_192024_2_;
|
||||
+ func_82242_a(-p_192024_2_);
|
||||
if (this.field_71068_ca < 0) {
|
||||
this.field_71068_ca = 0;
|
||||
this.field_71106_cc = 0.0F;
|
||||
@@ -1599,6 +1720,10 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null;
|
||||
this.field_184851_cj = true;
|
||||
DimensionType dimensiontype = this.field_71093_bK;
|
||||
if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) {
|
||||
- if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) {
|
||||
+ if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_ && teleporter instanceof net.minecraft.world.Teleporter) { //Forge: Fix non-vanilla teleporters triggering end credits
|
||||
this.func_213319_R();
|
||||
- this.func_71121_q().func_217434_e(this);
|
||||
+ this.func_71121_q().removePlayer(this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/entity/projectile/ArrowEntity.java
|
||||
+++ b/net/minecraft/entity/projectile/ArrowEntity.java
|
||||
@@ -59,7 +59,7 @@
|
||||
} else if (p_184555_1_.func_77973_b() == Items.field_151032_g) {
|
||||
this.field_184560_g = Potions.field_185229_a;
|
||||
this.field_184561_h.clear();
|
||||
- this.field_70180_af.func_187227_b(field_184559_f, -1);
|
||||
+ this.func_191507_d(-1); // Forge: fix MC-107941
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,7 +41,35 @@
|
||||
ItemStack itemstack1 = this.func_150910_a(itemstack, p_77659_2_, fluid.func_204524_b());
|
||||
if (!p_77659_1_.field_72995_K) {
|
||||
CriteriaTriggers.field_204813_j.func_204817_a((ServerPlayerEntity)p_77659_2_, new ItemStack(fluid.func_204524_b()));
|
||||
@@ -148,7 +165,19 @@
|
||||
@@ -67,7 +84,7 @@
|
||||
return ActionResult.func_226251_d_(itemstack);
|
||||
} else {
|
||||
BlockState blockstate = p_77659_1_.func_180495_p(blockpos);
|
||||
- BlockPos blockpos2 = blockstate.func_177230_c() instanceof ILiquidContainer && this.field_77876_a == Fluids.field_204546_a ? blockpos : blockpos1;
|
||||
+ BlockPos blockpos2 = canBlockContainFluid(p_77659_1_, blockpos, blockstate) ? blockpos : blockpos1;
|
||||
if (this.func_180616_a(p_77659_2_, p_77659_1_, blockpos2, blockraytraceresult)) {
|
||||
this.func_203792_a(p_77659_1_, itemstack, blockpos2);
|
||||
if (p_77659_2_ instanceof ServerPlayerEntity) {
|
||||
@@ -117,7 +134,8 @@
|
||||
BlockState blockstate = p_180616_2_.func_180495_p(p_180616_3_);
|
||||
Material material = blockstate.func_185904_a();
|
||||
boolean flag = blockstate.func_227032_a_(this.field_77876_a);
|
||||
- if (blockstate.func_196958_f() || flag || blockstate.func_177230_c() instanceof ILiquidContainer && ((ILiquidContainer)blockstate.func_177230_c()).func_204510_a(p_180616_2_, p_180616_3_, blockstate, this.field_77876_a)) {
|
||||
+ boolean canContainFluid = canBlockContainFluid(p_180616_2_, p_180616_3_, blockstate);
|
||||
+ if (blockstate.func_196958_f() || flag || canContainFluid) {
|
||||
if (p_180616_2_.field_73011_w.func_177500_n() && this.field_77876_a.func_207185_a(FluidTags.field_206959_a)) {
|
||||
int i = p_180616_3_.func_177958_n();
|
||||
int j = p_180616_3_.func_177956_o();
|
||||
@@ -127,7 +145,7 @@
|
||||
for(int l = 0; l < 8; ++l) {
|
||||
p_180616_2_.func_195594_a(ParticleTypes.field_197594_E, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
- } else if (blockstate.func_177230_c() instanceof ILiquidContainer && this.field_77876_a == Fluids.field_204546_a) {
|
||||
+ } else if (canContainFluid) {
|
||||
if (((ILiquidContainer)blockstate.func_177230_c()).func_204509_a(p_180616_2_, p_180616_3_, blockstate, ((FlowingFluid)this.field_77876_a).func_207204_a(false))) {
|
||||
this.func_203791_b(p_180616_1_, p_180616_2_, p_180616_3_);
|
||||
}
|
||||
@@ -148,7 +166,24 @@
|
||||
}
|
||||
|
||||
protected void func_203791_b(@Nullable PlayerEntity p_203791_1_, IWorld p_203791_2_, BlockPos p_203791_3_) {
|
||||
@@ -61,4 +89,9 @@
|
||||
+
|
||||
+ private final java.util.function.Supplier<? extends Fluid> fluidSupplier;
|
||||
+ public Fluid getFluid() { return fluidSupplier.get(); }
|
||||
+
|
||||
+ private boolean canBlockContainFluid(World worldIn, BlockPos posIn, BlockState blockstate)
|
||||
+ {
|
||||
+ return blockstate.func_177230_c() instanceof ILiquidContainer && ((ILiquidContainer)blockstate.func_177230_c()).func_204510_a(worldIn, posIn, blockstate, this.field_77876_a);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
--- a/net/minecraft/item/Food.java
|
||||
+++ b/net/minecraft/item/Food.java
|
||||
@@ -11,15 +11,26 @@
|
||||
private final boolean field_221472_c;
|
||||
private final boolean field_221473_d;
|
||||
private final boolean field_221474_e;
|
||||
- private final List<Pair<EffectInstance, Float>> field_221475_f;
|
||||
+ private final List<Pair<java.util.function.Supplier<EffectInstance>, Float>> field_221475_f;
|
||||
+
|
||||
+ private Food(Food.Builder builder) {
|
||||
+ this.field_221470_a = builder.field_221458_a;
|
||||
+ this.field_221471_b = builder.field_221459_b;
|
||||
+ this.field_221472_c = builder.field_221460_c;
|
||||
+ this.field_221473_d = builder.field_221461_d;
|
||||
+ this.field_221474_e = builder.field_221462_e;
|
||||
+ this.field_221475_f = builder.field_221463_f;
|
||||
+ }
|
||||
|
||||
+ // Forge: Use builder method instead
|
||||
+ @Deprecated
|
||||
private Food(int p_i50106_1_, float p_i50106_2_, boolean p_i50106_3_, boolean p_i50106_4_, boolean p_i50106_5_, List<Pair<EffectInstance, Float>> p_i50106_6_) {
|
||||
this.field_221470_a = p_i50106_1_;
|
||||
this.field_221471_b = p_i50106_2_;
|
||||
this.field_221472_c = p_i50106_3_;
|
||||
this.field_221473_d = p_i50106_4_;
|
||||
this.field_221474_e = p_i50106_5_;
|
||||
- this.field_221475_f = p_i50106_6_;
|
||||
+ this.field_221475_f = p_i50106_6_.stream().map(pair -> Pair.<java.util.function.Supplier<EffectInstance>, Float>of(pair::getLeft, pair.getRight())).collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
|
||||
public int func_221466_a() {
|
||||
@@ -43,7 +54,7 @@
|
||||
}
|
||||
|
||||
public List<Pair<EffectInstance, Float>> func_221464_f() {
|
||||
- return this.field_221475_f;
|
||||
+ return this.field_221475_f.stream().map(pair -> Pair.of(pair.getLeft() != null ? pair.getLeft().get() : null, pair.getRight())).collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
@@ -52,7 +63,7 @@
|
||||
private boolean field_221460_c;
|
||||
private boolean field_221461_d;
|
||||
private boolean field_221462_e;
|
||||
- private final List<Pair<EffectInstance, Float>> field_221463_f = Lists.newArrayList();
|
||||
+ private final List<Pair<java.util.function.Supplier<EffectInstance>, Float>> field_221463_f = Lists.newArrayList();
|
||||
|
||||
public Food.Builder func_221456_a(int p_221456_1_) {
|
||||
this.field_221458_a = p_221456_1_;
|
||||
@@ -78,14 +89,21 @@
|
||||
this.field_221462_e = true;
|
||||
return this;
|
||||
}
|
||||
+
|
||||
+ public Food.Builder effect(java.util.function.Supplier<EffectInstance> effectIn, float probability) {
|
||||
+ this.field_221463_f.add(Pair.of(effectIn, probability));
|
||||
+ return this;
|
||||
+ }
|
||||
|
||||
+ // Forge: Use supplier method instead
|
||||
+ @Deprecated
|
||||
public Food.Builder func_221452_a(EffectInstance p_221452_1_, float p_221452_2_) {
|
||||
- this.field_221463_f.add(Pair.of(p_221452_1_, p_221452_2_));
|
||||
+ this.field_221463_f.add(Pair.of(() -> p_221452_1_, p_221452_2_));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Food func_221453_d() {
|
||||
- return new Food(this.field_221458_a, this.field_221459_b, this.field_221460_c, this.field_221461_d, this.field_221462_e, this.field_221463_f);
|
||||
+ return new Food(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,18 @@
|
||||
if (p_77654_3_ instanceof ServerPlayerEntity) {
|
||||
ServerPlayerEntity serverplayerentity = (ServerPlayerEntity)p_77654_3_;
|
||||
CriteriaTriggers.field_193138_y.func_193148_a(serverplayerentity, p_77654_1_);
|
||||
@@ -44,4 +46,9 @@
|
||||
@@ -25,10 +27,6 @@
|
||||
p_77654_1_.func_190918_g(1);
|
||||
}
|
||||
|
||||
- if (!p_77654_2_.field_72995_K) {
|
||||
- p_77654_3_.func_195061_cb();
|
||||
- }
|
||||
-
|
||||
return p_77654_1_.func_190926_b() ? new ItemStack(Items.field_151133_ar) : p_77654_1_;
|
||||
}
|
||||
|
||||
@@ -44,4 +42,9 @@
|
||||
p_77659_2_.func_184598_c(p_77659_3_);
|
||||
return ActionResult.func_226248_a_(p_77659_2_.func_184586_b(p_77659_3_));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
--- a/net/minecraft/item/MusicDiscItem.java
|
||||
+++ b/net/minecraft/item/MusicDiscItem.java
|
||||
@@ -21,17 +21,40 @@
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class MusicDiscItem extends Item {
|
||||
+ @Deprecated // Forge: refer to WorldRender#playRecord. Modders: there's no need to reflectively modify this map!
|
||||
private static final Map<SoundEvent, MusicDiscItem> field_150928_b = Maps.newHashMap();
|
||||
private final int field_195977_c;
|
||||
+ @Deprecated // Forge: refer to soundSupplier
|
||||
private final SoundEvent field_185076_b;
|
||||
+ private final java.util.function.Supplier<SoundEvent> soundSupplier;
|
||||
|
||||
+ @Deprecated // Forge: Use the constructor that takes a supplier instead
|
||||
protected MusicDiscItem(int p_i48475_1_, SoundEvent p_i48475_2_, Item.Properties p_i48475_3_) {
|
||||
super(p_i48475_3_);
|
||||
this.field_195977_c = p_i48475_1_;
|
||||
this.field_185076_b = p_i48475_2_;
|
||||
field_150928_b.put(this.field_185076_b, this);
|
||||
+ this.soundSupplier = this.field_185076_b.delegate;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * For mod use, allows to create a music disc without having to create a new
|
||||
+ * SoundEvent before their registry event is fired.
|
||||
+ *
|
||||
+ * @param comparatorValue The value this music disc should output on the comparator. Must be between 0 and 15.
|
||||
+ * @param soundSupplier A supplier that provides the sound that should be played. Use a
|
||||
+ * {@link net.minecraftforge.fml.RegistryObject}{@code <SoundEvent>} or a
|
||||
+ * {@link net.minecraftforge.registries.IRegistryDelegate} for this parameter.
|
||||
+ * @param builder A set of {@link Item.Properties} that describe this item.
|
||||
+ */
|
||||
+ public MusicDiscItem(int comparatorValue, java.util.function.Supplier<SoundEvent> soundSupplier, Item.Properties builder)
|
||||
+ {
|
||||
+ super(builder);
|
||||
+ this.field_195977_c = comparatorValue;
|
||||
+ this.field_185076_b = null;
|
||||
+ this.soundSupplier = soundSupplier;
|
||||
+ }
|
||||
+
|
||||
public ActionResultType func_195939_a(ItemUseContext p_195939_1_) {
|
||||
World world = p_195939_1_.func_195991_k();
|
||||
BlockPos blockpos = p_195939_1_.func_195995_a();
|
||||
@@ -76,6 +99,6 @@
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public SoundEvent func_185075_h() {
|
||||
- return this.field_185076_b;
|
||||
+ return this.soundSupplier.get();
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
try {
|
||||
+ if (!net.minecraftforge.common.crafting.CraftingHelper.processConditions(entry.getValue(), "conditions")) {
|
||||
+ field_199521_c.info("Skipping loading recipe {} as it's conditions were not met", resourcelocation);
|
||||
+ field_199521_c.debug("Skipping loading recipe {} as it's conditions were not met", resourcelocation);
|
||||
+ continue;
|
||||
+ }
|
||||
IRecipe<?> irecipe = func_215377_a(resourcelocation, entry.getValue());
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/resources/ResourcePackList.java
|
||||
+++ b/net/minecraft/resources/ResourcePackList.java
|
||||
@@ -48,7 +48,7 @@
|
||||
private void func_198986_e() {
|
||||
List<Entry<String, T>> list = Lists.newArrayList(this.field_198988_b.entrySet());
|
||||
this.field_198988_b.clear();
|
||||
- list.stream().sorted(Entry.comparingByKey()).forEachOrdered((p_198984_1_) -> {
|
||||
+ list.stream().sorted(net.minecraftforge.fml.packs.ResourcePackLoader.getSorter()).forEachOrdered((p_198984_1_) -> {
|
||||
ResourcePackInfo resourcepackinfo = (ResourcePackInfo)this.field_198988_b.put(p_198984_1_.getKey(), p_198984_1_.getValue());
|
||||
});
|
||||
}
|
||||
@@ -9,7 +9,23 @@
|
||||
p_213187_0_.setUncaughtExceptionHandler((p_213206_0_, p_213206_1_) -> {
|
||||
field_147145_h.error(p_213206_1_);
|
||||
});
|
||||
@@ -336,6 +336,8 @@
|
||||
@@ -221,6 +221,7 @@
|
||||
private final LootTableManager field_200256_aj = new LootTableManager(this.field_229734_an_);
|
||||
private final AdvancementManager field_200257_ak = new AdvancementManager();
|
||||
private final FunctionManager field_200258_al = new FunctionManager(this);
|
||||
+ private final net.minecraftforge.common.loot.LootModifierManager lootManager = new net.minecraftforge.common.loot.LootModifierManager();
|
||||
private final FrameTimer field_213215_ap = new FrameTimer();
|
||||
private boolean field_205745_an;
|
||||
private boolean field_212205_ao;
|
||||
@@ -249,6 +250,7 @@
|
||||
this.field_195576_ac.func_219534_a(this.field_200256_aj);
|
||||
this.field_195576_ac.func_219534_a(this.field_200258_al);
|
||||
this.field_195576_ac.func_219534_a(this.field_200257_ak);
|
||||
+ field_195576_ac.func_219534_a(lootManager);
|
||||
this.field_213217_au = Util.func_215072_e();
|
||||
this.field_71294_K = p_i50590_10_;
|
||||
}
|
||||
@@ -336,6 +338,8 @@
|
||||
this.func_200245_b(new TranslationTextComponent("menu.loadingLevel"));
|
||||
SaveHandler savehandler = this.func_71254_M().func_197715_a(p_71247_1_, this);
|
||||
this.func_175584_a(this.func_71270_I(), savehandler);
|
||||
@@ -18,7 +34,7 @@
|
||||
WorldInfo worldinfo = savehandler.func_75757_d();
|
||||
WorldSettings worldsettings;
|
||||
if (worldinfo == null) {
|
||||
@@ -357,13 +359,13 @@
|
||||
@@ -357,13 +361,13 @@
|
||||
|
||||
worldinfo.func_230145_a_(this.getServerModName(), this.func_230045_q_().isPresent());
|
||||
this.func_195560_a(savehandler.func_75765_b(), worldinfo);
|
||||
@@ -33,7 +49,7 @@
|
||||
if (this.func_71242_L()) {
|
||||
p_213194_2_.func_176127_a(field_213219_c);
|
||||
}
|
||||
@@ -407,6 +409,7 @@
|
||||
@@ -407,6 +411,7 @@
|
||||
if (dimensiontype != DimensionType.field_223227_a_) {
|
||||
this.field_71305_c.put(dimensiontype, new ServerMultiWorld(serverworld1, this, this.field_213217_au, p_213194_1_, dimensiontype, this.field_71304_b, p_213194_4_));
|
||||
}
|
||||
@@ -41,7 +57,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -565,6 +568,7 @@
|
||||
@@ -565,6 +570,7 @@
|
||||
for(ServerWorld serverworld1 : this.func_212370_w()) {
|
||||
if (serverworld1 != null) {
|
||||
try {
|
||||
@@ -49,7 +65,7 @@
|
||||
serverworld1.close();
|
||||
} catch (IOException ioexception) {
|
||||
field_147145_h.error("Exception closing the level", (Throwable)ioexception);
|
||||
@@ -605,6 +609,7 @@
|
||||
@@ -605,6 +611,7 @@
|
||||
public void run() {
|
||||
try {
|
||||
if (this.func_71197_b()) {
|
||||
@@ -57,7 +73,7 @@
|
||||
this.field_211151_aa = Util.func_211177_b();
|
||||
this.field_147147_p.func_151315_a(new StringTextComponent(this.field_71286_C));
|
||||
this.field_147147_p.func_151321_a(new ServerStatusResponse.Version(SharedConstants.func_215069_a().getName(), SharedConstants.func_215069_a().getProtocolVersion()));
|
||||
@@ -636,9 +641,15 @@
|
||||
@@ -636,9 +643,15 @@
|
||||
this.field_71304_b.func_219897_b();
|
||||
this.field_71296_Q = true;
|
||||
}
|
||||
@@ -73,7 +89,7 @@
|
||||
} catch (Throwable throwable1) {
|
||||
field_147145_h.error("Encountered an unexpected exception", throwable1);
|
||||
CrashReport crashreport;
|
||||
@@ -655,6 +666,7 @@
|
||||
@@ -655,6 +668,7 @@
|
||||
field_147145_h.error("We were unable to save this crash report to disk.");
|
||||
}
|
||||
|
||||
@@ -81,7 +97,7 @@
|
||||
this.func_71228_a(crashreport);
|
||||
} finally {
|
||||
try {
|
||||
@@ -663,6 +675,7 @@
|
||||
@@ -663,6 +677,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
field_147145_h.error("Exception stopping the server", throwable);
|
||||
} finally {
|
||||
@@ -89,7 +105,7 @@
|
||||
this.func_71240_o();
|
||||
}
|
||||
|
||||
@@ -764,6 +777,7 @@
|
||||
@@ -764,6 +779,7 @@
|
||||
|
||||
protected void func_71217_p(BooleanSupplier p_71217_1_) {
|
||||
long i = Util.func_211178_c();
|
||||
@@ -97,7 +113,7 @@
|
||||
++this.field_71315_w;
|
||||
this.func_71190_q(p_71217_1_);
|
||||
if (i - this.field_147142_T >= 5000000000L) {
|
||||
@@ -778,6 +792,7 @@
|
||||
@@ -778,6 +794,7 @@
|
||||
|
||||
Collections.shuffle(Arrays.asList(agameprofile));
|
||||
this.field_147147_p.func_151318_b().func_151330_a(agameprofile);
|
||||
@@ -105,7 +121,7 @@
|
||||
}
|
||||
|
||||
if (this.field_71315_w % 6000 == 0) {
|
||||
@@ -805,6 +820,7 @@
|
||||
@@ -805,6 +822,7 @@
|
||||
long i1 = Util.func_211178_c();
|
||||
this.field_213215_ap.func_181747_a(i1 - i);
|
||||
this.field_71304_b.func_76319_b();
|
||||
@@ -113,7 +129,7 @@
|
||||
}
|
||||
|
||||
protected void func_71190_q(BooleanSupplier p_71190_1_) {
|
||||
@@ -812,7 +828,8 @@
|
||||
@@ -812,7 +830,8 @@
|
||||
this.func_193030_aL().func_73660_a();
|
||||
this.field_71304_b.func_219895_b("levels");
|
||||
|
||||
@@ -123,7 +139,7 @@
|
||||
if (serverworld.field_73011_w.func_186058_p() == DimensionType.field_223227_a_ || this.func_71255_r()) {
|
||||
this.field_71304_b.func_194340_a(() -> {
|
||||
return serverworld.func_72912_H().func_76065_j() + " " + Registry.field_212622_k.func_177774_c(serverworld.field_73011_w.func_186058_p());
|
||||
@@ -824,6 +841,7 @@
|
||||
@@ -824,6 +843,7 @@
|
||||
}
|
||||
|
||||
this.field_71304_b.func_76320_a("tick");
|
||||
@@ -131,7 +147,7 @@
|
||||
|
||||
try {
|
||||
serverworld.func_72835_b(p_71190_1_);
|
||||
@@ -832,12 +850,16 @@
|
||||
@@ -832,12 +852,16 @@
|
||||
serverworld.func_72914_a(crashreport);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -148,7 +164,7 @@
|
||||
this.field_71304_b.func_219895_b("connection");
|
||||
this.func_147137_ag().func_151269_c();
|
||||
this.field_71304_b.func_219895_b("players");
|
||||
@@ -878,6 +900,7 @@
|
||||
@@ -878,6 +902,7 @@
|
||||
OptionSpec<Integer> optionspec10 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1);
|
||||
OptionSpec<String> optionspec11 = optionparser.accepts("serverId").withRequiredArg();
|
||||
OptionSpec<String> optionspec12 = optionparser.nonOptions();
|
||||
@@ -156,7 +172,16 @@
|
||||
|
||||
try {
|
||||
OptionSet optionset = optionparser.parse(p_main_0_);
|
||||
@@ -910,6 +933,10 @@
|
||||
@@ -888,7 +913,7 @@
|
||||
|
||||
Path path = Paths.get("server.properties");
|
||||
ServerPropertiesProvider serverpropertiesprovider = new ServerPropertiesProvider(path);
|
||||
- serverpropertiesprovider.func_219035_b();
|
||||
+ if (optionset.has(optionspec1) || !Files.exists(path)) serverpropertiesprovider.func_219035_b();
|
||||
Path path1 = Paths.get("eula.txt");
|
||||
ServerEula servereula = new ServerEula(path1);
|
||||
if (optionset.has(optionspec1)) {
|
||||
@@ -910,6 +935,10 @@
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(s, field_152367_a.getName()));
|
||||
String s1 = Optional.ofNullable(optionset.valueOf(optionspec9)).orElse(serverpropertiesprovider.func_219034_a().field_219021_o);
|
||||
@@ -167,7 +192,7 @@
|
||||
final DedicatedServer dedicatedserver = new DedicatedServer(new File(s), serverpropertiesprovider, DataFixesManager.func_210901_a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache, LoggingChunkStatusListener::new, s1);
|
||||
dedicatedserver.func_71224_l(optionset.valueOf(optionspec7));
|
||||
dedicatedserver.func_71208_b(optionset.valueOf(optionspec10));
|
||||
@@ -927,6 +954,7 @@
|
||||
@@ -927,6 +956,7 @@
|
||||
Thread thread = new Thread("Server Shutdown Thread") {
|
||||
public void run() {
|
||||
dedicatedserver.func_71263_m(true);
|
||||
@@ -175,7 +200,7 @@
|
||||
}
|
||||
};
|
||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(field_147145_h));
|
||||
@@ -971,7 +999,7 @@
|
||||
@@ -971,7 +1001,7 @@
|
||||
}
|
||||
|
||||
public ServerWorld func_71218_a(DimensionType p_71218_1_) {
|
||||
@@ -184,7 +209,7 @@
|
||||
}
|
||||
|
||||
public Iterable<ServerWorld> func_212370_w() {
|
||||
@@ -1010,7 +1038,7 @@
|
||||
@@ -1010,7 +1040,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
@@ -193,7 +218,18 @@
|
||||
}
|
||||
|
||||
public CrashReport func_71230_b(CrashReport p_71230_1_) {
|
||||
@@ -1567,6 +1595,31 @@
|
||||
@@ -1396,6 +1426,10 @@
|
||||
public FunctionManager func_193030_aL() {
|
||||
return this.field_200258_al;
|
||||
}
|
||||
+
|
||||
+ public net.minecraftforge.common.loot.LootModifierManager getLootModifierManager() {
|
||||
+ return lootManager;
|
||||
+ }
|
||||
|
||||
public void func_193031_aM() {
|
||||
if (!this.func_213162_bc()) {
|
||||
@@ -1567,6 +1601,31 @@
|
||||
|
||||
public abstract boolean func_213199_b(GameProfile p_213199_1_);
|
||||
|
||||
|
||||
@@ -8,15 +8,17 @@
|
||||
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
|
||||
|
||||
String s3;
|
||||
@@ -118,6 +119,7 @@
|
||||
@@ -118,7 +119,9 @@
|
||||
field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fml.server.ServerModLoader.begin(this);
|
||||
field_155771_h.info("Loading properties");
|
||||
+ this.field_71340_o.func_219033_a(properties -> ServerProperties.func_218985_a(java.nio.file.Paths.get("server.properties")));
|
||||
ServerProperties serverproperties = this.field_71340_o.func_219034_a();
|
||||
if (this.func_71264_H()) {
|
||||
@@ -175,6 +177,7 @@
|
||||
this.func_71189_e("127.0.0.1");
|
||||
@@ -175,6 +178,7 @@
|
||||
if (!PreYggdrasilConverter.func_219587_e(this)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -24,7 +26,7 @@
|
||||
this.func_184105_a(new DedicatedPlayerList(this));
|
||||
long i = Util.func_211178_c();
|
||||
String s = serverproperties.field_219022_p;
|
||||
@@ -196,6 +199,7 @@
|
||||
@@ -196,6 +200,7 @@
|
||||
SkullTileEntity.func_184293_a(this.func_152358_ax());
|
||||
SkullTileEntity.func_184294_a(this.func_147130_as());
|
||||
PlayerProfileCache.func_187320_a(this.func_71266_T());
|
||||
@@ -32,7 +34,7 @@
|
||||
field_155771_h.info("Preparing level \"{}\"", (Object)this.func_71270_I());
|
||||
JsonObject jsonobject = new JsonObject();
|
||||
if (worldtype == WorldType.field_77138_c) {
|
||||
@@ -208,6 +212,7 @@
|
||||
@@ -208,6 +213,7 @@
|
||||
long l = Util.func_211178_c() - i;
|
||||
String s2 = String.format(Locale.ROOT, "%.3fs", (double)l / 1.0E9D);
|
||||
field_155771_h.info("Done ({})! For help, type \"help\"", (Object)s2);
|
||||
@@ -40,7 +42,7 @@
|
||||
if (serverproperties.field_219027_u != null) {
|
||||
this.func_200252_aR().func_223585_a(GameRules.field_223620_w).func_223570_a(serverproperties.field_219027_u, this);
|
||||
}
|
||||
@@ -233,7 +238,8 @@
|
||||
@@ -233,7 +239,8 @@
|
||||
}
|
||||
|
||||
Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a());
|
||||
@@ -50,7 +52,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,4 +553,9 @@
|
||||
@@ -547,4 +554,9 @@
|
||||
public boolean func_213199_b(GameProfile p_213199_1_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
|
||||
public PlayerList(MinecraftServer p_i50688_1_, int p_i50688_2_) {
|
||||
this.field_72400_f = p_i50688_1_;
|
||||
@@ -110,6 +111,14 @@
|
||||
@@ -109,7 +110,15 @@
|
||||
String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName();
|
||||
playerprofilecache.func_152649_a(gameprofile);
|
||||
CompoundNBT compoundnbt = this.func_72380_a(p_72355_2_);
|
||||
ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
|
||||
- ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
|
||||
+
|
||||
+ //Forge: Make sure the dimension hasn't been deleted, if so stick them in the overworld.
|
||||
+ ServerWorld serverworld = p_72355_2_.field_71093_bK != null ? this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK) : null ;
|
||||
+ if (serverworld == null) {
|
||||
+ p_72355_2_.field_71093_bK = DimensionType.field_223227_a_;
|
||||
+ serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
|
||||
|
||||
@@ -18,24 +18,39 @@
|
||||
this.field_199888_a = p_i48224_1_;
|
||||
this.field_199889_b = (Set<T>)(p_i48224_3_ ? Sets.newLinkedHashSet() : Sets.newHashSet());
|
||||
this.field_200150_c = p_i48224_2_;
|
||||
@@ -48,7 +52,7 @@
|
||||
@@ -45,11 +49,18 @@
|
||||
JsonArray jsonarray = new JsonArray();
|
||||
|
||||
for(Tag.ITagEntry<T> itagentry : this.field_200150_c) {
|
||||
+ if (!(itagentry instanceof net.minecraftforge.common.data.IOptionalTagEntry))
|
||||
itagentry.func_200576_a(jsonarray, p_200571_1_);
|
||||
}
|
||||
+ JsonArray optional = new JsonArray();
|
||||
+ for(Tag.ITagEntry<T> itagentry : this.field_200150_c) {
|
||||
+ if (itagentry instanceof net.minecraftforge.common.data.IOptionalTagEntry)
|
||||
+ itagentry.func_200576_a(optional, p_200571_1_);
|
||||
+ }
|
||||
|
||||
- jsonobject.addProperty("replace", false);
|
||||
+ jsonobject.addProperty("replace", replace);
|
||||
jsonobject.add("values", jsonarray);
|
||||
+ if (optional.size() > 0) jsonobject.add("optional", optional);
|
||||
return jsonobject;
|
||||
}
|
||||
@@ -77,6 +81,7 @@
|
||||
public static class Builder<T> {
|
||||
|
||||
@@ -74,9 +85,10 @@
|
||||
return this.field_199888_a;
|
||||
}
|
||||
|
||||
- public static class Builder<T> {
|
||||
+ public static class Builder<T> implements net.minecraftforge.common.extensions.IForgeTagBuilder<T> {
|
||||
private final Set<Tag.ITagEntry<T>> field_200052_a = Sets.newLinkedHashSet();
|
||||
private boolean field_200053_b;
|
||||
+ private boolean replace = false;
|
||||
|
||||
public static <T> Tag.Builder<T> func_200047_a() {
|
||||
return new Tag.Builder<>();
|
||||
@@ -103,6 +108,22 @@
|
||||
@@ -103,6 +115,22 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -58,7 +73,7 @@
|
||||
public Tag.Builder<T> func_200045_a(boolean p_200045_1_) {
|
||||
this.field_200053_b = p_200045_1_;
|
||||
return this;
|
||||
@@ -119,7 +140,7 @@
|
||||
@@ -119,7 +147,7 @@
|
||||
}
|
||||
|
||||
public Tag<T> func_200051_a(ResourceLocation p_200051_1_) {
|
||||
@@ -67,7 +82,7 @@
|
||||
}
|
||||
|
||||
public Tag.Builder<T> func_219783_a(Function<ResourceLocation, Optional<T>> p_219783_1_, JsonObject p_219783_2_) {
|
||||
@@ -143,8 +164,10 @@
|
||||
@@ -143,8 +171,10 @@
|
||||
}
|
||||
|
||||
this.field_200052_a.addAll(list);
|
||||
@@ -78,7 +93,7 @@
|
||||
}
|
||||
|
||||
public interface ITagEntry<T> {
|
||||
@@ -183,6 +206,8 @@
|
||||
@@ -183,6 +213,8 @@
|
||||
public Collection<T> func_200578_a() {
|
||||
return this.field_200165_a;
|
||||
}
|
||||
@@ -87,7 +102,7 @@
|
||||
}
|
||||
|
||||
public static class TagEntry<T> implements Tag.ITagEntry<T> {
|
||||
@@ -229,5 +254,7 @@
|
||||
@@ -229,5 +261,7 @@
|
||||
public void func_200576_a(JsonArray p_200576_1_, Function<T, ResourceLocation> p_200576_2_) {
|
||||
p_200576_1_.add("#" + this.func_200577_a());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/tags/TagCollection.java
|
||||
+++ b/net/minecraft/tags/TagCollection.java
|
||||
@@ -154,4 +154,8 @@
|
||||
public Map<ResourceLocation, Tag<T>> func_200039_c() {
|
||||
return this.field_199921_d;
|
||||
}
|
||||
+
|
||||
+ public Function<ResourceLocation, Optional<T>> getEntryLookup() {
|
||||
+ return this.field_200040_e;
|
||||
+ }
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
--- a/net/minecraft/tileentity/ConduitTileEntity.java
|
||||
+++ b/net/minecraft/tileentity/ConduitTileEntity.java
|
||||
@@ -131,7 +131,7 @@
|
||||
@@ -131,10 +131,8 @@
|
||||
BlockPos blockpos1 = this.field_174879_c.func_177982_a(j1, k1, l1);
|
||||
BlockState blockstate = this.field_145850_b.func_180495_p(blockpos1);
|
||||
|
||||
- for(Block block : field_205042_e) {
|
||||
+ for(Block block : net.minecraftforge.common.Tags.Blocks.SUPPORTS_CONDUIT.func_199885_a()) {
|
||||
if (blockstate.func_177230_c() == block) {
|
||||
- if (blockstate.func_177230_c() == block) {
|
||||
+ if (blockstate.isConduitFrame(this.field_145850_b, blockpos1, func_174877_v())) {
|
||||
this.field_205046_i.add(blockpos1);
|
||||
}
|
||||
- }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -375,6 +375,12 @@
|
||||
@@ -375,6 +375,17 @@
|
||||
return this.field_185364_H;
|
||||
}
|
||||
|
||||
@@ -50,11 +50,16 @@
|
||||
+ if (this == Biomes.field_76789_p || this == Biomes.field_76788_q) return Biomes.field_76788_q;
|
||||
+ return Biomes.field_76781_i;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public Biome getHill(net.minecraft.world.gen.INoiseRandom rand) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
public static class Builder {
|
||||
@Nullable
|
||||
private ConfiguredSurfaceBuilder<?> field_205422_a;
|
||||
@@ -526,6 +532,18 @@
|
||||
@@ -526,6 +537,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if (!this.field_76637_e.field_72995_K) {
|
||||
blockstate.func_196947_b(this.field_76637_e, p_177436_1_, p_177436_2_, p_177436_3_);
|
||||
- } else if (block1 != block && block1 instanceof ITileEntityProvider) {
|
||||
+ } else if (block1 != block && blockstate.hasTileEntity()) {
|
||||
+ } else if ((block1 != block || !p_177436_2_.hasTileEntity()) && blockstate.hasTileEntity()) {
|
||||
this.field_76637_e.func_175713_t(p_177436_1_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/chunk/storage/RegionFile.java
|
||||
+++ b/net/minecraft/world/chunk/storage/RegionFile.java
|
||||
@@ -32,6 +32,7 @@
|
||||
@@ -33,6 +33,7 @@
|
||||
private final IntBuffer field_76716_d;
|
||||
private final IntBuffer field_227127_h_;
|
||||
private final RegionBitmap field_227128_i_ = new RegionBitmap();
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public RegionFile(File p_i225784_1_, File p_i225784_2_) throws IOException {
|
||||
this(p_i225784_1_.toPath(), p_i225784_2_.toPath(), RegionFileVersion.field_227159_b_);
|
||||
@@ -39,6 +40,7 @@
|
||||
@@ -40,6 +41,7 @@
|
||||
|
||||
public RegionFile(Path p_i225785_1_, Path p_i225785_2_, RegionFileVersion p_i225785_3_) throws IOException {
|
||||
this.field_227125_e_ = p_i225785_3_;
|
||||
@@ -16,7 +16,7 @@
|
||||
if (!Files.isDirectory(p_i225785_2_)) {
|
||||
throw new IllegalArgumentException("Expected directory, got " + p_i225785_2_.toAbsolutePath());
|
||||
} else {
|
||||
@@ -61,6 +63,8 @@
|
||||
@@ -62,6 +64,8 @@
|
||||
if (k != 0) {
|
||||
int l = func_227142_b_(k);
|
||||
int i1 = func_227131_a_(k);
|
||||
@@ -25,7 +25,7 @@
|
||||
this.field_227128_i_.func_227120_a_(l, i1);
|
||||
}
|
||||
}
|
||||
@@ -69,6 +73,66 @@
|
||||
@@ -70,6 +74,66 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
+
|
||||
+ ByteBuffer header = ByteBuffer.allocate(5);
|
||||
+ this.field_76719_c.read(header, offset * 4096);
|
||||
+ header.flip();
|
||||
+ ((Buffer)header).flip();
|
||||
+
|
||||
+ if (header.remaining() < 5) {
|
||||
+ field_227122_a_.error("Chunk {},{} in {} header is truncated: expected 5 but read {}", chunkX, chunkZ, this.filePath.getFileName(), header.remaining());
|
||||
@@ -63,7 +63,7 @@
|
||||
+
|
||||
+ ByteBuffer header = ByteBuffer.allocate(5);
|
||||
+ this.field_76719_c.read(header, offset * 4096);
|
||||
+ header.flip();
|
||||
+ ((Buffer)header).flip();
|
||||
+
|
||||
+ if (header.remaining() < 5) {
|
||||
+ field_227122_a_.error("Chunk {} in {} header is truncated: expected 5 but read {}", chunk, this.filePath.getFileName(), header.remaining());
|
||||
@@ -78,7 +78,7 @@
|
||||
+
|
||||
+ ByteBuffer data = ByteBuffer.allocate(length + 4);
|
||||
+ this.field_76719_c.read(data, offset * 4096);
|
||||
+ data.flip();
|
||||
+ ((Buffer)data).flip();
|
||||
+
|
||||
+ if (data.remaining() < length + 4) {
|
||||
+ field_227122_a_.error("Chunk {} in {} is truncated: expected {} but read {}", chunk, this.filePath.getFileName(), length + 4, data.remaining());
|
||||
@@ -92,7 +92,7 @@
|
||||
private Path func_227145_e_(ChunkPos p_227145_1_) {
|
||||
String s = "c." + p_227145_1_.field_77276_a + "." + p_227145_1_.field_77275_b + ".mcc";
|
||||
return this.field_227124_d_.resolve(s);
|
||||
@@ -224,6 +288,7 @@
|
||||
@@ -225,6 +289,7 @@
|
||||
int j = this.field_76716_d.get(i);
|
||||
int k = func_227142_b_(j);
|
||||
int l = func_227131_a_(j);
|
||||
|
||||
+4
-4
@@ -13,11 +13,11 @@
|
||||
+ /**
|
||||
+ * FORGE: Add template parameter
|
||||
+ *
|
||||
+ * @param p_215194_1_
|
||||
+ * @param p_215194_2_
|
||||
+ * @param worldReaderIn
|
||||
+ * @param pos
|
||||
+ * @param p_215194_3_
|
||||
+ * @param p_215194_4_
|
||||
+ * @param p_215194_5_
|
||||
+ * @param blockInfo
|
||||
+ * @param placementSettingsIn
|
||||
+ * @param template The template being placed, can be null due to deprecated
|
||||
+ * method calls.
|
||||
+ * @see #process(IWorldReader, BlockPos,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/net/minecraft/world/gen/layer/HillsLayer.java
|
||||
+++ b/net/minecraft/world/gen/layer/HillsLayer.java
|
||||
@@ -59,7 +59,10 @@
|
||||
|
||||
if (p_215723_1_.func_202696_a(3) == 0 || k == 0) {
|
||||
int l = i;
|
||||
- if (i == field_202799_f) {
|
||||
+ Biome biome = Registry.field_212624_m.func_148745_a(i);
|
||||
+ Biome hill = biome == null ? null : biome.getHill(p_215723_1_);
|
||||
+ if (hill != null) l = Registry.field_212624_m.func_148757_b(hill);
|
||||
+ else if (i == field_202799_f) {
|
||||
l = field_202800_g;
|
||||
} else if (i == field_202803_j) {
|
||||
l = field_202804_k;
|
||||
@@ -16,15 +16,7 @@
|
||||
}
|
||||
|
||||
this.func_219229_a(p_219185_5_);
|
||||
@@ -482,6 +484,7 @@
|
||||
if (flag) {
|
||||
IChunk ichunk = ChunkSerializer.func_222656_a(this.field_219255_i, this.field_219269_w, this.field_219260_n, p_223172_1_, compoundnbt);
|
||||
ichunk.func_177432_b(this.field_219255_i.func_82737_E());
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(ichunk));
|
||||
return Either.left(ichunk);
|
||||
}
|
||||
|
||||
@@ -594,6 +597,7 @@
|
||||
@@ -594,6 +596,7 @@
|
||||
if (list != null) {
|
||||
list.forEach(chunk::func_76622_b);
|
||||
}
|
||||
@@ -32,19 +24,19 @@
|
||||
}
|
||||
|
||||
return chunk;
|
||||
@@ -679,6 +683,7 @@
|
||||
@@ -679,6 +682,7 @@
|
||||
|
||||
this.field_219255_i.func_217381_Z().func_230035_c_("chunkSave");
|
||||
CompoundNBT compoundnbt1 = ChunkSerializer.func_222645_a(this.field_219255_i, p_219229_1_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(p_219229_1_, compoundnbt1));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(p_219229_1_, p_219229_1_.getWorldForge() != null ? p_219229_1_.getWorldForge() : this.field_219255_i, compoundnbt1));
|
||||
this.func_219100_a(chunkpos, compoundnbt1);
|
||||
return true;
|
||||
} catch (Exception exception) {
|
||||
@@ -815,6 +820,7 @@
|
||||
for(int l = i - this.field_219247_A; l <= i + this.field_219247_A; ++l) {
|
||||
for(int k = j - this.field_219247_A; k <= j + this.field_219247_A; ++k) {
|
||||
ChunkPos chunkpos = new ChunkPos(l, k);
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireChunkWatch(p_219234_2_, p_219234_1_, chunkpos, field_219255_i);
|
||||
this.func_219199_a(p_219234_1_, chunkpos, new IPacket[2], !p_219234_2_, p_219234_2_);
|
||||
}
|
||||
}
|
||||
@@ -711,6 +715,7 @@
|
||||
|
||||
protected void func_219199_a(ServerPlayerEntity p_219199_1_, ChunkPos p_219199_2_, IPacket<?>[] p_219199_3_, boolean p_219199_4_, boolean p_219199_5_) {
|
||||
if (p_219199_1_.field_70170_p == this.field_219255_i) {
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireChunkWatch(p_219199_4_, p_219199_5_, p_219199_1_, p_219199_2_, this.field_219255_i);
|
||||
if (p_219199_5_ && !p_219199_4_) {
|
||||
ChunkHolder chunkholder = this.func_219219_b(p_219199_2_.func_201841_a());
|
||||
if (chunkholder != null) {
|
||||
@@ -11,3 +11,18 @@
|
||||
public static class Builder {
|
||||
private final ServerWorld field_186474_a;
|
||||
private final Map<LootParameter<?>, Object> field_216025_b = Maps.newIdentityHashMap();
|
||||
@@ -105,6 +109,14 @@
|
||||
this.field_186474_a = p_i46993_1_;
|
||||
}
|
||||
|
||||
+ public Builder(LootContext context) {
|
||||
+ this.field_186474_a = context.field_186499_b;
|
||||
+ this.field_216025_b.putAll(context.field_216036_f);
|
||||
+ this.field_216026_c.putAll(context.field_216037_g);
|
||||
+ this.field_216027_d = context.field_216035_a;
|
||||
+ this.field_186475_b = context.field_186498_a;
|
||||
+ }
|
||||
+
|
||||
public LootContext.Builder func_216023_a(Random p_216023_1_) {
|
||||
this.field_216027_d = p_216023_1_;
|
||||
return this;
|
||||
@@ -16,7 +16,23 @@
|
||||
this.field_216128_f = p_i51265_3_;
|
||||
this.field_216129_g = LootFunctionManager.func_216241_a(p_i51265_3_);
|
||||
}
|
||||
@@ -90,8 +90,8 @@
|
||||
@@ -75,6 +75,7 @@
|
||||
|
||||
}
|
||||
|
||||
+ @Deprecated //Use other method or manually call ForgeHooks.modifyLoot
|
||||
public void func_216120_b(LootContext p_216120_1_, Consumer<ItemStack> p_216120_2_) {
|
||||
this.func_216114_a(p_216120_1_, func_216124_a(p_216120_2_));
|
||||
}
|
||||
@@ -82,6 +83,7 @@
|
||||
public List<ItemStack> func_216113_a(LootContext p_216113_1_) {
|
||||
List<ItemStack> list = Lists.newArrayList();
|
||||
this.func_216120_b(p_216113_1_, list::add);
|
||||
+ list = net.minecraftforge.common.ForgeHooks.modifyLoot(list, p_216113_1_);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -90,8 +92,8 @@
|
||||
}
|
||||
|
||||
public void func_227506_a_(ValidationTracker p_227506_1_) {
|
||||
@@ -27,7 +43,7 @@
|
||||
}
|
||||
|
||||
for(int j = 0; j < this.field_216128_f.length; ++j) {
|
||||
@@ -202,6 +202,41 @@
|
||||
@@ -202,6 +204,41 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +85,7 @@
|
||||
public static class Serializer implements JsonDeserializer<LootTable>, JsonSerializer<LootTable> {
|
||||
public LootTable deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
|
||||
JsonObject jsonobject = JSONUtils.func_151210_l(p_deserialize_1_, "loot table");
|
||||
@@ -227,7 +262,7 @@
|
||||
@@ -227,7 +264,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
--- a/net/minecraft/world/storage/loot/LootTableManager.java
|
||||
+++ b/net/minecraft/world/storage/loot/LootTableManager.java
|
||||
@@ -43,7 +43,8 @@
|
||||
@@ -42,8 +42,8 @@
|
||||
}
|
||||
|
||||
p_212853_1_.forEach((p_223385_1_, p_223385_2_) -> {
|
||||
try {
|
||||
- try {
|
||||
- LootTable loottable = field_186526_b.fromJson(p_223385_2_, LootTable.class);
|
||||
+ net.minecraft.resources.IResource res = p_212853_2_.func_199002_a(getPreparedPath(p_223385_1_));
|
||||
+ try (net.minecraft.resources.IResource res = p_212853_2_.func_199002_a(getPreparedPath(p_223385_1_));){
|
||||
+ LootTable loottable = net.minecraftforge.common.ForgeHooks.loadLootTable(field_186526_b, p_223385_1_, p_223385_2_, res == null || !res.func_199026_d().equals("Default"), this);
|
||||
builder.put(p_223385_1_, loottable);
|
||||
} catch (Exception exception) {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.fml.loading;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
public class BackgroundWaiter {
|
||||
private static ExecutorService runner = Executors.newSingleThreadExecutor();
|
||||
|
||||
public static void runAndTick(Runnable r, Runnable tick) {
|
||||
final Future<?> work = runner.submit(r);
|
||||
do {
|
||||
tick.run();
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
} while (!work.isDone());
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,8 @@ public class FMLLoader
|
||||
private static Predicate<String> classLoaderExclusions;
|
||||
private static String launchHandlerName;
|
||||
private static FMLCommonLaunchHandler commonLaunchHandler;
|
||||
public static Runnable progressWindowTick;
|
||||
public static BackgroundScanHandler backgroundScanHandler;
|
||||
|
||||
static void onInitialLoad(IEnvironment environment, Set<String> otherServices) throws IncompatibleEnvironmentException
|
||||
{
|
||||
@@ -179,7 +181,7 @@ public class FMLLoader
|
||||
commonLaunchHandler = (FMLCommonLaunchHandler)launchHandler.get();
|
||||
naming = commonLaunchHandler.getNaming();
|
||||
dist = commonLaunchHandler.getDist();
|
||||
EarlyProgressVisualization.INSTANCE.accept(dist);
|
||||
progressWindowTick = EarlyProgressVisualization.INSTANCE.accept(dist);
|
||||
StartupMessageManager.modLoaderConsumer().ifPresent(c->c.accept("Early Loading!"));
|
||||
accessTransformer.getExtension().accept(Pair.of(naming, "srg"));
|
||||
|
||||
@@ -200,14 +202,16 @@ public class FMLLoader
|
||||
languageLoadingProvider.addForgeLanguage(forgePath);
|
||||
|
||||
runtimeDistCleaner.getExtension().accept(dist);
|
||||
progressWindowTick.run();
|
||||
}
|
||||
public static Map<IModFile.Type, List<ModFile>> beginModScan(final Map<String,?> arguments)
|
||||
{
|
||||
LOGGER.debug(SCAN,"Scanning for Mod Locators");
|
||||
modDiscoverer = new ModDiscoverer(arguments);
|
||||
final BackgroundScanHandler backgroundScanHandler = modDiscoverer.discoverMods();
|
||||
backgroundScanHandler = modDiscoverer.discoverMods();
|
||||
loadingModList = backgroundScanHandler.getLoadingModList();
|
||||
commonLaunchHandler.addLibraries(backgroundScanHandler.getModFiles().getOrDefault(IModFile.Type.LIBRARY, Collections.emptyList()));
|
||||
progressWindowTick.run();
|
||||
return backgroundScanHandler.getModFiles();
|
||||
}
|
||||
|
||||
@@ -239,6 +243,7 @@ public class FMLLoader
|
||||
{
|
||||
FMLLoader.launchClassLoader = (TransformingClassLoader) launchClassLoader.getInstance();
|
||||
StartupMessageManager.modLoaderConsumer().ifPresent(c->c.accept("Launching minecraft"));
|
||||
progressWindowTick.run();
|
||||
}
|
||||
|
||||
public static LoadingModList getLoadingModList()
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public class ModDirTransformerDiscoverer implements ITransformerDiscoveryService
|
||||
}
|
||||
|
||||
private static void scan(final Path gameDirectory) {
|
||||
final Path modsDir = gameDirectory.resolve(FMLPaths.MODSDIR.relative());
|
||||
final Path modsDir = gameDirectory.resolve(FMLPaths.MODSDIR.relative()).toAbsolutePath().normalize();
|
||||
transformers = new ArrayList<>();
|
||||
locators = new ArrayList<>();
|
||||
if (!Files.exists(modsDir)) {
|
||||
@@ -74,9 +74,9 @@ public class ModDirTransformerDiscoverer implements ITransformerDiscoveryService
|
||||
if (LamdbaExceptionUtils.uncheck(() -> Files.size(path)) == 0) return;
|
||||
try (ZipFile zf = new ZipFile(new File(path.toUri()))) {
|
||||
if (zf.getEntry("META-INF/services/cpw.mods.modlauncher.api.ITransformationService") != null) {
|
||||
transformers.add(path.toRealPath());
|
||||
transformers.add(path);
|
||||
} else if (zf.getEntry("META-INF/services/net.minecraftforge.forgespi.locating.IModLocator") != null) {
|
||||
locators.add(path.toRealPath());
|
||||
locators.add(path);
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
LogManager.getLogger().error("Zip Error when loading jar file {}", path, ioe);
|
||||
|
||||
+12
-15
@@ -81,21 +81,6 @@ public class BackgroundScanHandler
|
||||
scannedFiles.add(file);
|
||||
}
|
||||
|
||||
public List<ModFile> getScannedFiles() {
|
||||
if (!pendingFiles.isEmpty()) {
|
||||
modContentScanner.shutdown();
|
||||
try {
|
||||
modContentScanner.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
return scannedFiles;
|
||||
}
|
||||
|
||||
public List<ModFile> getAllFiles() {
|
||||
return allFiles;
|
||||
}
|
||||
|
||||
public void setLoadingModList(LoadingModList loadingModList)
|
||||
{
|
||||
this.loadingModList = loadingModList;
|
||||
@@ -105,4 +90,16 @@ public class BackgroundScanHandler
|
||||
{
|
||||
return loadingModList;
|
||||
}
|
||||
|
||||
public void waitForScanToComplete(final Runnable ticker) {
|
||||
modContentScanner.shutdown();
|
||||
do {
|
||||
ticker.run();
|
||||
try {
|
||||
modContentScanner.awaitTermination(50, TimeUnit.MILLISECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.interrupted();
|
||||
}
|
||||
} while (!modContentScanner.isShutdown());
|
||||
}
|
||||
}
|
||||
+13
-6
@@ -57,10 +57,10 @@ public class ModAnnotation
|
||||
return value;
|
||||
}
|
||||
}
|
||||
ElementType type;
|
||||
Type asmType;
|
||||
String member;
|
||||
Map<String,Object> values = Maps.newHashMap();
|
||||
private final ElementType type;
|
||||
private final Type asmType;
|
||||
private final String member;
|
||||
private final Map<String,Object> values = Maps.newHashMap();
|
||||
|
||||
private ArrayList<Object> arrayList;
|
||||
private String arrayName;
|
||||
@@ -71,10 +71,17 @@ public class ModAnnotation
|
||||
this.member = member;
|
||||
}
|
||||
|
||||
@Deprecated // TODO 1.16 remove this
|
||||
public ModAnnotation(ElementType type, Type asmType, ModAnnotation parent)
|
||||
{
|
||||
this.type = type;
|
||||
this(asmType, parent);
|
||||
}
|
||||
|
||||
public ModAnnotation(Type asmType, ModAnnotation parent)
|
||||
{
|
||||
this.type = parent.type;
|
||||
this.asmType = asmType;
|
||||
this.member = parent.member;
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
@@ -132,7 +139,7 @@ public class ModAnnotation
|
||||
}
|
||||
public ModAnnotation addChildAnnotation(String name, String desc)
|
||||
{
|
||||
ModAnnotation child = new ModAnnotation(ElementType.PARAMETER, Type.getType(desc), this);
|
||||
ModAnnotation child = new ModAnnotation(Type.getType(desc), this);
|
||||
addProperty(name, child.getValues());
|
||||
return child;
|
||||
}
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class ModClassVisitor extends ClassVisitor
|
||||
public void buildData(final Set<ModFileScanData.ClassData> classes, final Set<ModFileScanData.AnnotationData> annotations) {
|
||||
classes.add(new ModFileScanData.ClassData(this.asmType, this.asmSuperType, this.interfaces));
|
||||
final List<ModFileScanData.AnnotationData> collect = this.annotations.stream().
|
||||
filter(ma->ModFileScanData.interestingAnnotations().test(ma.asmType)).
|
||||
filter(ma->ModFileScanData.interestingAnnotations().test(ma.getASMType())).
|
||||
map(a -> ModAnnotation.fromModAnnotation(this.asmType, a)).collect(Collectors.toList());
|
||||
annotations.addAll(collect);
|
||||
}
|
||||
|
||||
+84
-43
@@ -19,36 +19,45 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.progress;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.lwjgl.glfw.GLFWErrorCallback;
|
||||
import org.lwjgl.glfw.GLFWImage;
|
||||
import org.lwjgl.glfw.GLFWVidMode;
|
||||
import org.lwjgl.opengl.GL;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL14;
|
||||
import org.lwjgl.stb.STBEasyFont;
|
||||
import org.lwjgl.stb.STBImage;
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryUsage;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.util.List;
|
||||
import java.util.function.IntSupplier;
|
||||
import java.util.function.LongSupplier;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.lwjgl.glfw.Callbacks.glfwFreeCallbacks;
|
||||
import static org.lwjgl.glfw.GLFW.*;
|
||||
import static org.lwjgl.glfw.GLFW.glfwCreateWindow;
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
import static org.lwjgl.system.MemoryStack.stackPush;
|
||||
import static org.lwjgl.system.MemoryUtil.NULL;
|
||||
|
||||
|
||||
class ClientVisualization implements EarlyProgressVisualization.Visualization {
|
||||
private final int screenWidth = 800;
|
||||
private final int screenHeight = 400;
|
||||
private final int screenWidth = 854;
|
||||
private final int screenHeight = 480;
|
||||
private long window;
|
||||
private Thread thread;
|
||||
private boolean running;
|
||||
private Thread renderThread = new Thread(this::renderThreadFunc);
|
||||
|
||||
private boolean running = true;
|
||||
|
||||
private void initWindow() {
|
||||
GLFWErrorCallback.createPrint(System.err).set();
|
||||
@@ -64,8 +73,13 @@ class ClientVisualization implements EarlyProgressVisualization.Visualization {
|
||||
}
|
||||
|
||||
glfwDefaultWindowHints();
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
|
||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
|
||||
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
|
||||
|
||||
window = glfwCreateWindow(screenWidth, screenHeight, "FML early loading progress", NULL, NULL);
|
||||
if (window == NULL) {
|
||||
@@ -86,13 +100,34 @@ class ClientVisualization implements EarlyProgressVisualization.Visualization {
|
||||
(vidmode.width() - pWidth.get(0)) / 2 + monPosLeft.get(0),
|
||||
(vidmode.height() - pHeight.get(0)) / 2 + monPosTop.get(0)
|
||||
);
|
||||
IntBuffer iconWidth = stack.mallocInt(1);
|
||||
IntBuffer iconHeight = stack.mallocInt(1);
|
||||
IntBuffer iconChannels = stack.mallocInt(1);
|
||||
final GLFWImage.Buffer glfwImages = GLFWImage.mallocStack(1, stack);
|
||||
byte[] icon;
|
||||
try {
|
||||
icon = ByteStreams.toByteArray(getClass().getClassLoader().getResourceAsStream("forge_icon.png"));
|
||||
final ByteBuffer iconBuf = stack.malloc(icon.length);
|
||||
iconBuf.put(icon);
|
||||
((Buffer)iconBuf).position(0);
|
||||
final ByteBuffer imgBuffer = STBImage.stbi_load_from_memory(iconBuf, iconWidth, iconHeight, iconChannels, 4);
|
||||
if (imgBuffer == null) {
|
||||
throw new NullPointerException("Failed to load window icon"); // fall down to catch block
|
||||
}
|
||||
glfwImages.position(0);
|
||||
glfwImages.width(iconWidth.get(0));
|
||||
glfwImages.height(iconHeight.get(0));
|
||||
((Buffer)imgBuffer).position(0);
|
||||
glfwImages.pixels(imgBuffer);
|
||||
glfwImages.position(0);
|
||||
glfwSetWindowIcon(window, glfwImages);
|
||||
STBImage.stbi_image_free(imgBuffer);
|
||||
} catch (NullPointerException | IOException e) {
|
||||
System.err.println("Failed to load forge logo");
|
||||
}
|
||||
}
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
glfwShowWindow(window);
|
||||
GL.createCapabilities();
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
private void renderProgress() {
|
||||
@@ -103,20 +138,10 @@ class ClientVisualization implements EarlyProgressVisualization.Visualization {
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
// // replace with more modern opengl?
|
||||
// glBegin(GL_QUADS);
|
||||
// glColor3f(0.1f, 0.1f, 0.9f);
|
||||
// glVertex2f(0, 0);
|
||||
// glVertex2f(0, screenHeight);
|
||||
// glVertex2f(screenWidth * progress, screenHeight);
|
||||
// glVertex2f(screenWidth * progress, 0);
|
||||
// glEnd();
|
||||
|
||||
glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
glEnable(GL_BLEND);
|
||||
renderMessages();
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
private static float clamp(float num, float min, float max) {
|
||||
@@ -229,39 +254,55 @@ class ClientVisualization implements EarlyProgressVisualization.Visualization {
|
||||
MemoryUtil.memFree(charBuffer);
|
||||
}
|
||||
|
||||
private void closeWindow() {
|
||||
glfwFreeCallbacks(window);
|
||||
glfwDestroyWindow(window);
|
||||
glfwTerminate();
|
||||
glfwSetErrorCallback(null).free();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
thread = new Thread(this::run);
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
private void run() {
|
||||
running = true;
|
||||
initWindow();
|
||||
private void renderThreadFunc() {
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
GL.createCapabilities();
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
while (running) {
|
||||
renderProgress();
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
} catch (InterruptedException ignored) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
closeWindow();
|
||||
glfwMakeContextCurrent(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void join() {
|
||||
public Runnable start() {
|
||||
initWindow();
|
||||
renderThread.setDaemon(true); // Don't hang the game if it terminates before handoff (i.e. datagen)
|
||||
renderThread.start();
|
||||
return org.lwjgl.glfw.GLFW::glfwPollEvents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long handOffWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, final LongSupplier monitorSupplier) {
|
||||
running = false;
|
||||
try {
|
||||
thread.join();
|
||||
} catch (InterruptedException e) {
|
||||
renderThread.join();
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
glfwSetWindowTitle(window, title.get());
|
||||
glfwSetWindowSize(window, width.getAsInt(), height.getAsInt());
|
||||
if (monitorSupplier.getAsLong() != 0L)
|
||||
glfwSetWindowMonitor(window, monitorSupplier.getAsLong(), 0, 0, width.getAsInt(), height.getAsInt(), GLFW_DONT_CARE);
|
||||
glfwMakeContextCurrent(window);
|
||||
GL.createCapabilities();
|
||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
renderProgress();
|
||||
glfwSwapInterval(0);
|
||||
glfwSwapBuffers(window);
|
||||
glfwSwapInterval(1);
|
||||
return window;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replacedWindow() {
|
||||
return running; // TODO is this method necessary? it's only used to prevent the vanilla icon set, which we do want as it only occurs after handoff
|
||||
}
|
||||
}
|
||||
+26
-15
@@ -22,36 +22,47 @@ package net.minecraftforge.fml.loading.progress;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.IntSupplier;
|
||||
import java.util.function.LongSupplier;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum EarlyProgressVisualization {
|
||||
INSTANCE;
|
||||
|
||||
private Visualization visualization;
|
||||
|
||||
public void accept(final Dist dist) {
|
||||
if (visualization != null) return;
|
||||
// We don't show the window on Mac because mac is super mega triple shit and can't handle anything out of the ordinary
|
||||
final boolean ismac = System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("mac");
|
||||
visualization = dist.isClient() && !ismac && Boolean.parseBoolean(System.getProperty("fml.earlyprogresswindow", "true")) ? new ClientVisualization() : new NoVisualization();
|
||||
visualization.start();
|
||||
public Runnable accept(final Dist dist) {
|
||||
visualization = dist.isClient() && Boolean.parseBoolean(System.getProperty("fml.earlyprogresswindow", "true")) ? new ClientVisualization() : new NoVisualization();
|
||||
return visualization.start();
|
||||
}
|
||||
|
||||
public void join() {
|
||||
visualization.join();
|
||||
public long handOffWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, final LongSupplier monitor) {
|
||||
return visualization.handOffWindow(width, height, title, monitor);
|
||||
}
|
||||
|
||||
public boolean replacedWindow() {
|
||||
return visualization.replacedWindow();
|
||||
}
|
||||
|
||||
interface Visualization {
|
||||
void start();
|
||||
void join();
|
||||
Runnable start();
|
||||
|
||||
default long handOffWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, LongSupplier monitorSupplier) {
|
||||
return new LongSupplier() {
|
||||
@Override
|
||||
public long getAsLong() {
|
||||
return org.lwjgl.glfw.GLFW.glfwCreateWindow(width.getAsInt(), height.getAsInt(), title.get(), monitorSupplier.getAsLong(), 0L);
|
||||
}
|
||||
}.getAsLong();
|
||||
}
|
||||
|
||||
default boolean replacedWindow() { return false; }
|
||||
}
|
||||
|
||||
private static class NoVisualization implements Visualization {
|
||||
@Override
|
||||
public void start() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void join() {
|
||||
public Runnable start() {
|
||||
return () -> {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -39,6 +39,7 @@ public class StartupMessageManager {
|
||||
return messages.values().stream().flatMap(Collection::stream).
|
||||
sorted(Comparator.comparingLong(Message::getTimestamp).thenComparing(Message::getText).reversed()).
|
||||
map(m -> Pair.of((int) ((ts - m.timestamp) / 1e6), m)).
|
||||
limit(5).
|
||||
collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -102,7 +103,7 @@ public class StartupMessageManager {
|
||||
return Optional.of(s -> messages.get(MessageType.LOC).add(new Message(s, MessageType.LOC)));
|
||||
}
|
||||
|
||||
static Optional<Consumer<String>> mcLoaderConsumer() {
|
||||
public static Optional<Consumer<String>> mcLoaderConsumer() {
|
||||
return Optional.of(s-> messages.get(MessageType.MC).add(new Message(s, MessageType.MC)));
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:emerald_block",
|
||||
"minecraft:gold_block",
|
||||
"minecraft:diamond_block",
|
||||
"minecraft:iron_block"
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:prismarine",
|
||||
"minecraft:prismarine_bricks",
|
||||
"minecraft:sea_lantern",
|
||||
"minecraft:dark_prismarine"
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:emerald_block",
|
||||
"minecraft:gold_block",
|
||||
"minecraft:diamond_block",
|
||||
"minecraft:iron_block"
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:prismarine",
|
||||
"minecraft:prismarine_bricks",
|
||||
"minecraft:sea_lantern",
|
||||
"minecraft:dark_prismarine"
|
||||
]
|
||||
}
|
||||
@@ -24,7 +24,7 @@ c3ecb601615c300cafbdd9dc28f9fc42b6835dcd assets\data_gen_test\models\block\birch
|
||||
3bcea12fba8714c7ad7c00f440f3e7546a8958ce assets\data_gen_test\models\block\birch_fence_gate_open.json
|
||||
13b47687fb80334b3e51781e691f53f8073843a7 assets\data_gen_test\models\block\birch_fence_gate_wall.json
|
||||
dd0a89461e5f72c08ccf6f3d07bce9c290019022 assets\data_gen_test\models\block\birch_fence_gate_wall_open.json
|
||||
1d0f4dceda264528ae1b1f5f971ae84202405e51 assets\data_gen_test\models\block\block.json
|
||||
49948428acf0defe004ff07718afd9b50fc41326 assets\data_gen_test\models\block\block.json
|
||||
42fcd2c027f204708f423808f22f6e4c0d5f586b assets\data_gen_test\models\block\cobblestone_wall_post.json
|
||||
21d8ec1410152c67c4b7a06184be545ef1e1d0cf assets\data_gen_test\models\block\cobblestone_wall_side.json
|
||||
26c80ee9a99336b434c9984445bfcf01b25f2cd0 assets\data_gen_test\models\block\cube.json
|
||||
@@ -63,3 +63,4 @@ bf2e445b48b024354a69138b20a4a4a8aa5d15d1 assets\minecraft\blockstates\oak_trapdo
|
||||
a012d6d92bab1c91913bd0f2dc0492a0fce916f2 assets\minecraft\blockstates\wall_torch.json
|
||||
4fbaf6f4a3ea05cc071076e27f44ac81f9cc50e3 data\data_gen_test\advancements\conditional.json
|
||||
ed4cbf1a3a2f5d8969f6346fdc9acdbe81d0c919 data\data_gen_test\recipes\conditional.json
|
||||
2c3e2073a1597baaa2970de5ae1649781f87aef8 data\data_gen_test\tags\blocks\test.json
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"gui_light": "side",
|
||||
"display": {
|
||||
"gui": {
|
||||
"rotation": [
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:diamond_block",
|
||||
"#minecraft:stone_bricks"
|
||||
],
|
||||
"optional": [
|
||||
"chisel:marble/raw",
|
||||
"#forge:storage_blocks/ruby"
|
||||
]
|
||||
}
|
||||
@@ -141,18 +141,18 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
float v1 = sectZ1 * sectPx;
|
||||
|
||||
// Bottom
|
||||
buffer.func_225582_a_(sectX0, 0, sectZ0).func_225583_a_(u0, v0).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, 0, sectZ0).func_225583_a_(u1, v0).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, 0, sectZ1).func_225583_a_(u1, v1).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX0, 0, sectZ1).func_225583_a_(u0, v1).func_227885_a_(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, 0, sectZ0).tex(u0, v0).color(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, 0, sectZ0).tex(u1, v0).color(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, 0, sectZ1).tex(u1, v1).color(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, 0, sectZ1).tex(u0, v1).color(bCol, bCol, bCol, ALPHA).endVertex();
|
||||
|
||||
if (fancy)
|
||||
{
|
||||
// Top
|
||||
buffer.func_225582_a_(sectX0, HEIGHT, sectZ0).func_225583_a_(u0, v0).func_227885_a_(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX0, HEIGHT, sectZ1).func_225583_a_(u0, v1).func_227885_a_(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, HEIGHT, sectZ1).func_225583_a_(u1, v1).func_227885_a_(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, HEIGHT, sectZ0).func_225583_a_(u1, v0).func_227885_a_(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, HEIGHT, sectZ0).tex(u0, v0).color(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, HEIGHT, sectZ1).tex(u0, v1).color(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, HEIGHT, sectZ1).tex(u1, v1).color(1, 1, 1, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, HEIGHT, sectZ0).tex(u1, v0).color(1, 1, 1, ALPHA).endVertex();
|
||||
|
||||
float slice;
|
||||
float sliceCoord0;
|
||||
@@ -167,10 +167,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
if (slice > -CULL_DIST)
|
||||
{
|
||||
slice += INSET;
|
||||
buffer.func_225582_a_(slice, 0, sectZ1).func_225583_a_(sliceCoord0, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(slice, HEIGHT, sectZ1).func_225583_a_(sliceCoord1, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(slice, HEIGHT, sectZ0).func_225583_a_(sliceCoord1, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(slice, 0, sectZ0).func_225583_a_(sliceCoord0, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, 0, sectZ1).tex(sliceCoord0, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, HEIGHT, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, HEIGHT, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, 0, sectZ0).tex(sliceCoord0, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
slice -= INSET;
|
||||
}
|
||||
|
||||
@@ -179,10 +179,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
if (slice <= CULL_DIST)
|
||||
{
|
||||
slice -= INSET;
|
||||
buffer.func_225582_a_(slice, 0, sectZ0).func_225583_a_(sliceCoord0, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(slice, HEIGHT, sectZ0).func_225583_a_(sliceCoord1, v0).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(slice, HEIGHT, sectZ1).func_225583_a_(sliceCoord1, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(slice, 0, sectZ1).func_225583_a_(sliceCoord0, v1).func_227885_a_(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, 0, sectZ0).tex(sliceCoord0, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, HEIGHT, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, HEIGHT, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
buffer.pos(slice, 0, sectZ1).tex(sliceCoord0, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
|
||||
slice += INSET;
|
||||
}
|
||||
}
|
||||
@@ -196,10 +196,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
if (slice > -CULL_DIST)
|
||||
{
|
||||
slice += INSET;
|
||||
buffer.func_225582_a_(sectX0, 0, slice).func_225583_a_(u0, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX0, HEIGHT, slice).func_225583_a_(u0, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, HEIGHT, slice).func_225583_a_(u1, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, 0, slice).func_225583_a_(u1, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, 0, slice).tex(u0, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, HEIGHT, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, HEIGHT, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, 0, slice).tex(u1, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
slice -= INSET;
|
||||
}
|
||||
|
||||
@@ -208,10 +208,10 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
if (slice <= CULL_DIST)
|
||||
{
|
||||
slice -= INSET;
|
||||
buffer.func_225582_a_(sectX1, 0, slice).func_225583_a_(u1, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX1, HEIGHT, slice).func_225583_a_(u1, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX0, HEIGHT, slice).func_225583_a_(u0, sliceCoord1).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.func_225582_a_(sectX0, 0, slice).func_225583_a_(u0, sliceCoord0).func_227885_a_(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, 0, slice).tex(u1, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX1, HEIGHT, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, HEIGHT, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
buffer.pos(sectX0, 0, slice).tex(u0, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
|
||||
slice += INSET;
|
||||
}
|
||||
}
|
||||
@@ -290,12 +290,12 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
|
||||
double totalOffset = cloudTicks + partialTicks;
|
||||
|
||||
double x = entity.prevPosX + (entity.func_226277_ct_() - entity.prevPosX) * partialTicks
|
||||
double x = entity.prevPosX + (entity.getPosX() - entity.prevPosX) * partialTicks
|
||||
+ totalOffset * 0.03;
|
||||
double y = mc.world.dimension.getCloudHeight()
|
||||
- (entity.lastTickPosY + (entity.func_226278_cu_() - entity.lastTickPosY) * partialTicks)
|
||||
- (entity.lastTickPosY + (entity.getPosY() - entity.lastTickPosY) * partialTicks)
|
||||
+ 0.33;
|
||||
double z = entity.prevPosZ + (entity.func_226281_cx_() - entity.prevPosZ) * partialTicks;
|
||||
double z = entity.prevPosZ + (entity.getPosZ() - entity.prevPosZ) * partialTicks;
|
||||
|
||||
int scale = getScale();
|
||||
|
||||
@@ -388,7 +388,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
VertexBuffer.unbindBuffer(); // Unbind buffer and disable pointers.
|
||||
|
||||
buffer.limit(0);
|
||||
for (int i = 0; i < FORMAT.func_227894_c_().size(); i++)
|
||||
for (int i = 0; i < FORMAT.getElements().size(); i++)
|
||||
FORMAT.getElements().get(i).getUsage().postDraw(FORMAT, i, FORMAT.getSize(), buffer);
|
||||
buffer.position(0);
|
||||
|
||||
@@ -454,4 +454,4 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
*/
|
||||
@@ -39,6 +39,7 @@ import static org.lwjgl.opengl.GL20.glVertexAttribPointer;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -54,6 +55,7 @@ import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.core.async.ThreadNameCachingStrategy;
|
||||
@@ -172,11 +174,17 @@ public class ForgeHooksClient
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent(context, info, target, partialTicks, matrix, buffers));
|
||||
}
|
||||
|
||||
@Deprecated // TODO: Remove in 1.16
|
||||
public static void dispatchRenderLast(WorldRenderer context, MatrixStack mat, float partialTicks)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderWorldLastEvent(context, mat, partialTicks));
|
||||
}
|
||||
|
||||
public static void dispatchRenderLast(WorldRenderer context, MatrixStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderWorldLastEvent(context, mat, partialTicks, projectionMatrix, finishTimeNano));
|
||||
}
|
||||
|
||||
public static boolean renderSpecificFirstPersonHand(Hand hand, MatrixStack mat, IRenderTypeBuffer buffers, int light, float partialTicks, float interpPitch, float swingProgress, float equipProgress, ItemStack stack)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderHandEvent(hand, mat, buffers, light, partialTicks, interpPitch, swingProgress, equipProgress, stack));
|
||||
@@ -184,6 +192,7 @@ public class ForgeHooksClient
|
||||
|
||||
public static void onTextureStitchedPre(AtlasTexture map, Set<ResourceLocation> resourceLocations)
|
||||
{
|
||||
StartupMessageManager.mcLoaderConsumer().ifPresent(c->c.accept("Atlas Stitching : "+map.getTextureLocation().toString()));
|
||||
ModLoader.get().postEvent(new TextureStitchEvent.Pre(map, resourceLocations));
|
||||
// ModelLoader.White.INSTANCE.register(map); // TODO Custom TAS
|
||||
}
|
||||
@@ -286,7 +295,7 @@ public class ForgeHooksClient
|
||||
for (int z = -distance; z <= distance; ++z)
|
||||
{
|
||||
BlockPos pos = center.add(x, 0, z);
|
||||
Biome biome = world.func_225526_b_(pos.getX(), pos.getY(), pos.getZ());
|
||||
Biome biome = world.getNoiseBiome(pos.getX(), pos.getY(), pos.getZ());
|
||||
int colour = 0xFFFFFF; // TODO: biome.getSkyColorByTemp(biome.getTemperature(pos));
|
||||
r += (colour & 0xFF0000) >> 16;
|
||||
g += (colour & 0x00FF00) >> 8;
|
||||
@@ -388,7 +397,7 @@ public class ForgeHooksClient
|
||||
private static final net.minecraft.client.renderer.Matrix4f flipX;
|
||||
private static final net.minecraft.client.renderer.Matrix3f flipXNormal;
|
||||
static {
|
||||
flipX = Matrix4f.func_226593_a_(-1,1,1);
|
||||
flipX = Matrix4f.makeScale(-1,1,1);
|
||||
flipXNormal = new net.minecraft.client.renderer.Matrix3f(flipX);
|
||||
}
|
||||
|
||||
@@ -398,20 +407,20 @@ public class ForgeHooksClient
|
||||
model = model.handlePerspective(cameraTransformType, stack);
|
||||
|
||||
// If the stack is not empty, the code has added a matrix for us to use.
|
||||
if (!stack.func_227867_d_())
|
||||
if (!stack.clear())
|
||||
{
|
||||
// Apply the transformation to the real matrix stack, flipping for left hand
|
||||
net.minecraft.client.renderer.Matrix4f tMat = stack.func_227866_c_().func_227870_a_();
|
||||
net.minecraft.client.renderer.Matrix3f nMat = stack.func_227866_c_().func_227872_b_();
|
||||
net.minecraft.client.renderer.Matrix4f tMat = stack.getLast().getMatrix();
|
||||
net.minecraft.client.renderer.Matrix3f nMat = stack.getLast().getNormal();
|
||||
if (leftHandHackery)
|
||||
{
|
||||
tMat.multiplyBackward(flipX);
|
||||
tMat.func_226595_a_(flipX);
|
||||
tMat.mul(flipX);
|
||||
nMat.multiplyBackward(flipXNormal);
|
||||
nMat.func_226118_b_(flipXNormal);
|
||||
nMat.mul(flipXNormal);
|
||||
}
|
||||
matrixStack.func_227866_c_().func_227870_a_().func_226595_a_(tMat);
|
||||
matrixStack.func_227866_c_().func_227872_b_().func_226118_b_(nMat);
|
||||
matrixStack.getLast().getMatrix().mul(tMat);
|
||||
matrixStack.getLast().getNormal().mul(nMat);
|
||||
}
|
||||
return model;
|
||||
}
|
||||
@@ -420,10 +429,10 @@ public class ForgeHooksClient
|
||||
|
||||
public static void preDraw(Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
|
||||
{
|
||||
VertexFormatElement attr = format.func_227894_c_().get(element);
|
||||
VertexFormatElement attr = format.getElements().get(element);
|
||||
int count = attr.getElementCount();
|
||||
int constant = attr.getType().getGlConstant();
|
||||
buffer.position(format.getOffset(element));
|
||||
((Buffer)buffer).position(format.getOffset(element));
|
||||
switch(attrType)
|
||||
{
|
||||
case POSITION:
|
||||
@@ -461,7 +470,7 @@ public class ForgeHooksClient
|
||||
|
||||
public static void postDraw(Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
|
||||
{
|
||||
VertexFormatElement attr = format.func_227894_c_().get(element);
|
||||
VertexFormatElement attr = format.getElements().get(element);
|
||||
switch(attrType)
|
||||
{
|
||||
case POSITION:
|
||||
@@ -490,7 +499,7 @@ public class ForgeHooksClient
|
||||
|
||||
public static int getColorIndex(VertexFormat fmt)
|
||||
{
|
||||
ImmutableList<VertexFormatElement> elements = fmt.func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> elements = fmt.getElements();
|
||||
for(int i=0;i<elements.size();i++)
|
||||
{
|
||||
if (elements.get(i).getUsage() == Usage.COLOR)
|
||||
@@ -527,9 +536,9 @@ public class ForgeHooksClient
|
||||
{
|
||||
ResourceLocation overlayTexture = fluidStateIn.getFluid().getAttributes().getOverlayTexture();
|
||||
return new TextureAtlasSprite[] {
|
||||
Minecraft.getInstance().func_228015_a_(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getStillTexture(world, pos)),
|
||||
Minecraft.getInstance().func_228015_a_(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getFlowingTexture(world, pos)),
|
||||
overlayTexture == null ? null : Minecraft.getInstance().func_228015_a_(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(overlayTexture),
|
||||
Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getStillTexture(world, pos)),
|
||||
Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStateIn.getFluid().getAttributes().getFlowingTexture(world, pos)),
|
||||
overlayTexture == null ? null : Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(overlayTexture),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -566,7 +575,7 @@ public class ForgeHooksClient
|
||||
v1.sub(t1);
|
||||
v2.sub(t2);
|
||||
v2.cross(v1);
|
||||
v2.func_229194_d_();
|
||||
v2.normalize();
|
||||
|
||||
int x = ((byte) Math.round(v2.getX() * 127)) & 0xFF;
|
||||
int y = ((byte) Math.round(v2.getY() * 127)) & 0xFF;
|
||||
@@ -701,7 +710,7 @@ public class ForgeHooksClient
|
||||
|
||||
public static boolean onGuiMouseScrollPre(MouseHelper mouseHelper, Screen guiScreen, double scrollDelta)
|
||||
{
|
||||
MainWindow mainWindow = guiScreen.getMinecraft().func_228018_at_();
|
||||
MainWindow mainWindow = guiScreen.getMinecraft().getMainWindow();
|
||||
double mouseX = mouseHelper.getMouseX() * (double) mainWindow.getScaledWidth() / (double) mainWindow.getWidth();
|
||||
double mouseY = mouseHelper.getMouseY() * (double) mainWindow.getScaledHeight() / (double) mainWindow.getHeight();
|
||||
Event event = new GuiScreenEvent.MouseScrollEvent.Pre(guiScreen, mouseX, mouseY, scrollDelta);
|
||||
@@ -710,7 +719,7 @@ public class ForgeHooksClient
|
||||
|
||||
public static boolean onGuiMouseScrollPost(MouseHelper mouseHelper, Screen guiScreen, double scrollDelta)
|
||||
{
|
||||
MainWindow mainWindow = guiScreen.getMinecraft().func_228018_at_();
|
||||
MainWindow mainWindow = guiScreen.getMinecraft().getMainWindow();
|
||||
double mouseX = mouseHelper.getMouseX() * (double) mainWindow.getScaledWidth() / (double) mainWindow.getWidth();
|
||||
double mouseY = mouseHelper.getMouseY() * (double) mainWindow.getScaledHeight() / (double) mainWindow.getHeight();
|
||||
Event event = new GuiScreenEvent.MouseScrollEvent.Post(guiScreen, mouseX, mouseY, scrollDelta);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
|
||||
public PlayerSPPushOutOfBlocksEvent(PlayerEntity player)
|
||||
{
|
||||
super(player);
|
||||
this.minY = player.func_226278_cu_() + 0.5D;
|
||||
this.minY = player.getPosY() + 0.5D;
|
||||
}
|
||||
|
||||
public void setMinY(double value) {
|
||||
|
||||
@@ -19,8 +19,11 @@
|
||||
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
@@ -32,10 +35,13 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
* {@link #nameplateContent} contains the content being rendered on the name plate/tag. This can be changed by mods.<br>
|
||||
* {@link #originalContent} contains the original content being rendered on the name plate/tag. This cannot be
|
||||
* changed by mods.<br>
|
||||
* {@link #entityRenderer} contains the entity renderer instance that renders the name plate/tag. This cannot be
|
||||
* changed by mods.<br>
|
||||
* {@link #matrixStack} contains the matrix stack instance involved in rendering the name plate/tag. This cannot
|
||||
* be changed by mods.<br>
|
||||
* {@link #renderTypeBuffer} contains the render type buffer instance involved in rendering the name plate/tag.
|
||||
* This cannot be changed by mods.<br>
|
||||
* {@link #packedLight} contains the sky and block light values used in rendering the name plate/tag.<br>
|
||||
* <br>
|
||||
* This event has a result. {@link HasResult}. <br>
|
||||
* ALLOW will force-render name plate/tag, DEFAULT will ignore the hook and continue using the vanilla check
|
||||
@@ -49,16 +55,26 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
|
||||
private String nameplateContent;
|
||||
private final String originalContent;
|
||||
private final EntityRenderer<?> entityRenderer;
|
||||
private final MatrixStack matrixStack;
|
||||
private final IRenderTypeBuffer renderTypeBuffer;
|
||||
private final int packedLight;
|
||||
|
||||
@Deprecated //TODO 1.16: upon removal, also remove @Nullable on getEntityRenderer(), and update its javadoc
|
||||
public RenderNameplateEvent(Entity entity, String content, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer)
|
||||
{
|
||||
this(entity, content, null, matrixStack, renderTypeBuffer, 0);
|
||||
}
|
||||
|
||||
public RenderNameplateEvent(Entity entity, String content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight)
|
||||
{
|
||||
super(entity);
|
||||
this.originalContent = content;
|
||||
this.setContent(this.originalContent);
|
||||
this.entityRenderer = entityRenderer;
|
||||
this.matrixStack = matrixStack;
|
||||
this.renderTypeBuffer = renderTypeBuffer;
|
||||
this.packedLight = packedLight;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,6 +101,15 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
return this.originalContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* The entity renderer that renders the name plate/tag, if it was provided
|
||||
*/
|
||||
@Nullable
|
||||
public EntityRenderer<?> getEntityRenderer()
|
||||
{
|
||||
return this.entityRenderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* The matrix stack used during the rendering of the name plate/tag
|
||||
*/
|
||||
@@ -100,4 +125,12 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
{
|
||||
return this.renderTypeBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The packed values of sky and block light used during the rendering of the name plate/tag
|
||||
*/
|
||||
public int getPackedLight()
|
||||
{
|
||||
return this.packedLight;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ package net.minecraftforge.client.event;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
|
||||
public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event
|
||||
@@ -28,11 +29,26 @@ public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event
|
||||
private final WorldRenderer context;
|
||||
private final MatrixStack mat;
|
||||
private final float partialTicks;
|
||||
private final Matrix4f projectionMatrix;
|
||||
private final long finishTimeNano;
|
||||
|
||||
@Deprecated // TODO: Remove in 1.16
|
||||
public RenderWorldLastEvent(WorldRenderer context, MatrixStack mat, float partialTicks)
|
||||
{
|
||||
this.context = context;
|
||||
this.mat = mat;
|
||||
this.partialTicks = partialTicks;
|
||||
this.projectionMatrix = null;
|
||||
this.finishTimeNano = 0;
|
||||
}
|
||||
|
||||
public RenderWorldLastEvent(WorldRenderer context, MatrixStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano)
|
||||
{
|
||||
this.context = context;
|
||||
this.mat = mat;
|
||||
this.partialTicks = partialTicks;
|
||||
this.projectionMatrix = projectionMatrix;
|
||||
this.finishTimeNano = finishTimeNano;
|
||||
}
|
||||
|
||||
public WorldRenderer getContext()
|
||||
@@ -49,4 +65,14 @@ public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event
|
||||
{
|
||||
return partialTicks;
|
||||
}
|
||||
|
||||
public Matrix4f getProjectionMatrix()
|
||||
{
|
||||
return projectionMatrix;
|
||||
}
|
||||
|
||||
public long getFinishTimeNano()
|
||||
{
|
||||
return finishTimeNano;
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,6 @@ public interface IForgeModelTransform
|
||||
*/
|
||||
default TransformationMatrix getPartTransformation(Object part)
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
}
|
||||
+35
-36
@@ -36,22 +36,22 @@ public interface IForgeTransformationMatrix
|
||||
|
||||
default boolean isIdentity()
|
||||
{
|
||||
return getTransformaion().equals(TransformationMatrix.func_227983_a_());
|
||||
return getTransformaion().equals(TransformationMatrix.identity());
|
||||
}
|
||||
|
||||
default void push(MatrixStack stack)
|
||||
{
|
||||
stack.func_227860_a_();
|
||||
stack.push();
|
||||
|
||||
Vector3f trans = getTransformaion().getTranslation();
|
||||
stack.func_227861_a_(trans.getX(), trans.getY(), trans.getZ());
|
||||
stack.translate(trans.getX(), trans.getY(), trans.getZ());
|
||||
|
||||
stack.func_227863_a_(getTransformaion().func_227989_d_());
|
||||
stack.rotate(getTransformaion().getRotationLeft());
|
||||
|
||||
Vector3f scale = getTransformaion().getScale();
|
||||
stack.func_227862_a_(scale.getX(), scale.getY(), scale.getZ());
|
||||
stack.scale(scale.getX(), scale.getY(), scale.getZ());
|
||||
|
||||
stack.func_227863_a_(getTransformaion().getRightRot());
|
||||
stack.rotate(getTransformaion().getRightRot());
|
||||
|
||||
}
|
||||
|
||||
@@ -59,67 +59,66 @@ public interface IForgeTransformationMatrix
|
||||
{
|
||||
if (getTransformaion().isIdentity()) return other;
|
||||
if (other.isIdentity()) return getTransformaion();
|
||||
Matrix4f m = getTransformaion().func_227988_c_();
|
||||
m.func_226595_a_(other.func_227988_c_());
|
||||
Matrix4f m = getTransformaion().getMatrix();
|
||||
m.mul(other.getMatrix());
|
||||
return new TransformationMatrix(m);
|
||||
}
|
||||
|
||||
default TransformationMatrix inverse()
|
||||
{
|
||||
if (isIdentity()) return getTransformaion();
|
||||
Matrix4f m = getTransformaion().func_227988_c_().func_226601_d_();
|
||||
m.func_226600_c_();
|
||||
Matrix4f m = getTransformaion().getMatrix().copy();
|
||||
m.invert();
|
||||
return new TransformationMatrix(m);
|
||||
}
|
||||
|
||||
default void transformPosition(Vector4f position)
|
||||
{
|
||||
position.func_229372_a_(getTransformaion().func_227988_c_());
|
||||
position.transform(getTransformaion().getMatrix());
|
||||
}
|
||||
|
||||
default void transformNormal(Vector3f normal)
|
||||
{
|
||||
normal.func_229188_a_(getTransformaion().getNormalMatrix());
|
||||
normal.func_229194_d_();
|
||||
normal.transform(getTransformaion().getNormalMatrix());
|
||||
normal.normalize();
|
||||
}
|
||||
|
||||
default Direction rotateTransform(Direction facing)
|
||||
{
|
||||
return Direction.func_229385_a_(getTransformaion().func_227988_c_(), facing);
|
||||
return Direction.rotateFace(getTransformaion().getMatrix(), facing);
|
||||
}
|
||||
|
||||
/**
|
||||
* convert transformation from assuming center-block system to corner-block system
|
||||
* convert transformation from assuming center-block system to opposing-corner-block system
|
||||
*/
|
||||
default TransformationMatrix blockCenterToCorner()
|
||||
{
|
||||
TransformationMatrix transform = getTransformaion();
|
||||
if (transform.isIdentity()) return TransformationMatrix.func_227983_a_();
|
||||
|
||||
Matrix4f ret = transform.func_227988_c_();
|
||||
Matrix4f tmp = Matrix4f.func_226599_b_(.5f, .5f, .5f);
|
||||
ret.multiplyBackward(tmp);
|
||||
tmp.func_226591_a_();
|
||||
tmp.setTranslation(-.5f, -.5f, -.5f);
|
||||
ret.func_226595_a_(tmp);
|
||||
return new TransformationMatrix(ret);
|
||||
return applyOrigin(new Vector3f(.5f, .5f, .5f));
|
||||
}
|
||||
|
||||
/**
|
||||
* convert transformation from assuming corner-block system to center-block system
|
||||
* convert transformation from assuming opposing-corner-block system to center-block system
|
||||
*/
|
||||
default TransformationMatrix blockCornerToCenter()
|
||||
{
|
||||
TransformationMatrix transform = getTransformaion();
|
||||
if (transform.isIdentity()) return TransformationMatrix.func_227983_a_();
|
||||
|
||||
Matrix4f ret = transform.func_227988_c_();
|
||||
Matrix4f tmp = Matrix4f.func_226599_b_(-.5f, -.5f, -.5f);
|
||||
ret.multiplyBackward(tmp);
|
||||
tmp.func_226591_a_();
|
||||
tmp.setTranslation(.5f, .5f, .5f);
|
||||
ret.func_226595_a_(tmp);
|
||||
return new TransformationMatrix(ret);
|
||||
return applyOrigin(new Vector3f(-.5f, -.5f, -.5f));
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply this transformation to a different origin.
|
||||
* Can be used for switching between coordinate systems.
|
||||
* Parameter is relative to the current origin.
|
||||
*/
|
||||
default TransformationMatrix applyOrigin(Vector3f origin) {
|
||||
TransformationMatrix transform = getTransformaion();
|
||||
if (transform.isIdentity()) return TransformationMatrix.identity();
|
||||
|
||||
Matrix4f ret = transform.getMatrix();
|
||||
Matrix4f tmp = Matrix4f.makeTranslate(origin.getX(), origin.getY(), origin.getZ());
|
||||
ret.multiplyBackward(tmp);
|
||||
tmp.setIdentity();
|
||||
tmp.setTranslation(-origin.getX(), -origin.getY(), -origin.getZ());
|
||||
ret.mul(tmp);
|
||||
return new TransformationMatrix(ret);
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
@@ -43,7 +44,7 @@ public interface IForgeVertexBuilder
|
||||
|
||||
// Copy of func_227889_a_, but enables tinting
|
||||
default void addVertexData(MatrixStack.Entry matrixStack, BakedQuad bakedQuad, float red, float green, float blue, int lightmapCoord, int overlayColor, boolean readExistingColor) {
|
||||
getVertexBuilder().func_227890_a_(matrixStack, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
|
||||
getVertexBuilder().addQuad(matrixStack, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
|
||||
}
|
||||
|
||||
// Copy of func_227889_a_ with alpha support
|
||||
@@ -56,13 +57,13 @@ public interface IForgeVertexBuilder
|
||||
addVertexData(matrixEntry, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, alpha, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
|
||||
}
|
||||
|
||||
// Copy of func_227890_a_ with alpha support
|
||||
// Copy of addQuad with alpha support
|
||||
default void addVertexData(MatrixStack.Entry matrixEntry, BakedQuad bakedQuad, float[] baseBrightness, float red, float green, float blue, float alpha, int[] lightmapCoords, int overlayCoords, boolean readExistingColor) {
|
||||
int[] aint = bakedQuad.getVertexData();
|
||||
Vec3i faceNormal = bakedQuad.getFace().getDirectionVec();
|
||||
Vector3f normal = new Vector3f((float)faceNormal.getX(), (float)faceNormal.getY(), (float)faceNormal.getZ());
|
||||
Matrix4f matrix4f = matrixEntry.func_227870_a_();
|
||||
normal.func_229188_a_(matrixEntry.func_227872_b_());
|
||||
Matrix4f matrix4f = matrixEntry.getMatrix();
|
||||
normal.transform(matrixEntry.getNormal());
|
||||
int intSize = DefaultVertexFormats.BLOCK.getIntegerSize();
|
||||
int vertexCount = aint.length / intSize;
|
||||
|
||||
@@ -71,7 +72,7 @@ public interface IForgeVertexBuilder
|
||||
IntBuffer intbuffer = bytebuffer.asIntBuffer();
|
||||
|
||||
for(int v = 0; v < vertexCount; ++v) {
|
||||
intbuffer.clear();
|
||||
((Buffer)intbuffer).clear();
|
||||
intbuffer.put(aint, v * 8, 8);
|
||||
float f = bytebuffer.getFloat(0);
|
||||
float f1 = bytebuffer.getFloat(4);
|
||||
@@ -100,31 +101,31 @@ public interface IForgeVertexBuilder
|
||||
float f9 = bytebuffer.getFloat(16);
|
||||
float f10 = bytebuffer.getFloat(20);
|
||||
Vector4f pos = new Vector4f(f, f1, f2, 1.0F);
|
||||
pos.func_229372_a_(matrix4f);
|
||||
applyBakedNormals(normal, bytebuffer, matrixEntry.func_227872_b_());
|
||||
((IVertexBuilder)this).func_225588_a_(pos.getX(), pos.getY(), pos.getZ(), cr, cg, cb, ca, f9, f10, overlayCoords, lightmapCoord, normal.getX(), normal.getY(), normal.getZ());
|
||||
pos.transform(matrix4f);
|
||||
applyBakedNormals(normal, bytebuffer, matrixEntry.getNormal());
|
||||
((IVertexBuilder)this).addVertex(pos.getX(), pos.getY(), pos.getZ(), cr, cg, cb, ca, f9, f10, overlayCoords, lightmapCoord, normal.getX(), normal.getY(), normal.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
default int applyBakedLighting(int lightmapCoord, ByteBuffer data) {
|
||||
int bl = LightTexture.func_228450_a_(lightmapCoord);
|
||||
int sl = LightTexture.func_228454_b_(lightmapCoord);
|
||||
int bl = lightmapCoord&0xFFFF;
|
||||
int sl = (lightmapCoord>>16)&0xFFFF;
|
||||
int offset = LightUtil.getLightOffset(0) * 4; // int offset for vertex 0 * 4 bytes per int
|
||||
int blBaked = Short.toUnsignedInt(data.getShort(offset)) >> 4;
|
||||
int slBaked = Short.toUnsignedInt(data.getShort(offset + 2)) >> 4;
|
||||
int blBaked = Short.toUnsignedInt(data.getShort(offset));
|
||||
int slBaked = Short.toUnsignedInt(data.getShort(offset + 2));
|
||||
bl = Math.max(bl, blBaked);
|
||||
sl = Math.max(sl, slBaked);
|
||||
return LightTexture.func_228451_a_(bl, sl);
|
||||
return bl | (sl<<16);
|
||||
}
|
||||
|
||||
|
||||
default void applyBakedNormals(Vector3f generated, ByteBuffer data, Matrix3f normalTransform) {
|
||||
byte nx = data.get(28);
|
||||
byte ny = data.get(29);
|
||||
byte nz = data.get(30);
|
||||
if (nx != 0 || ny != 0 || nz != 0) {
|
||||
generated.set(nx / 127f, ny / 127f, nz / 127f);
|
||||
generated.func_229188_a_(normalTransform);
|
||||
generated.transform(normalTransform);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,9 +107,9 @@ public class ForgeIngameGui extends IngameGui
|
||||
@Override
|
||||
public void renderGameOverlay(float partialTicks)
|
||||
{
|
||||
this.scaledWidth = this.mc.func_228018_at_().getScaledWidth();
|
||||
this.scaledHeight = this.mc.func_228018_at_().getScaledHeight();
|
||||
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.func_228018_at_());
|
||||
this.scaledWidth = this.mc.getMainWindow().getScaledWidth();
|
||||
this.scaledHeight = this.mc.getMainWindow().getScaledHeight();
|
||||
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.getMainWindow());
|
||||
renderHealthMount = mc.player.getRidingEntity() instanceof LivingEntity;
|
||||
renderFood = mc.player.getRidingEntity() == null;
|
||||
renderJumpBar = mc.player.isRidingHorse();
|
||||
@@ -845,14 +845,14 @@ public class ForgeIngameGui extends IngameGui
|
||||
public void update()
|
||||
{
|
||||
Entity entity = this.mc.getRenderViewEntity();
|
||||
this.rayTraceBlock = entity.func_213324_a(rayTraceDistance, 0.0F, false);
|
||||
this.rayTraceFluid = entity.func_213324_a(rayTraceDistance, 0.0F, true);
|
||||
this.rayTraceBlock = entity.pick(rayTraceDistance, 0.0F, false);
|
||||
this.rayTraceFluid = entity.pick(rayTraceDistance, 0.0F, true);
|
||||
}
|
||||
@Override protected void func_230024_c_(){}
|
||||
@Override protected void func_230025_d_(){}
|
||||
@Override protected void renderDebugInfoLeft(){}
|
||||
@Override protected void renderDebugInfoRight(){}
|
||||
private List<String> getLeft()
|
||||
{
|
||||
List<String> ret = this.call();
|
||||
List<String> ret = this.getDebugInfoLeft();
|
||||
ret.add("");
|
||||
ret.add("Debug: Pie [shift]: " + (this.mc.gameSettings.showDebugProfilerChart ? "visible" : "hidden") + " FPS [alt]: " + (this.mc.gameSettings.showLagometer ? "visible" : "hidden"));
|
||||
ret.add("For help: press F3 + Q");
|
||||
|
||||
@@ -189,9 +189,9 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable
|
||||
Tessellator tess = Tessellator.getInstance();
|
||||
BufferBuilder worldr = tess.getBuffer();
|
||||
|
||||
double scale = client.func_228018_at_().getGuiScaleFactor();
|
||||
double scale = client.getMainWindow().getGuiScaleFactor();
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
GL11.glScissor((int)(left * scale), (int)(client.func_228018_at_().getFramebufferHeight() - (bottom * scale)),
|
||||
GL11.glScissor((int)(left * scale), (int)(client.getMainWindow().getFramebufferHeight() - (bottom * scale)),
|
||||
(int)(width * scale), (int)(height * scale));
|
||||
|
||||
if (this.client.world != null)
|
||||
@@ -206,10 +206,10 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
final float texScale = 32.0F;
|
||||
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
worldr.func_225582_a_(this.left, this.bottom, 0.0D).func_225583_a_(this.left / texScale, (this.bottom + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(this.right, this.bottom, 0.0D).func_225583_a_(this.right / texScale, (this.bottom + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(this.right, this.top, 0.0D).func_225583_a_(this.right / texScale, (this.top + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(this.left, this.top, 0.0D).func_225583_a_(this.left / texScale, (this.top + (int)this.scrollDistance) / texScale).func_225586_a_(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.pos(this.left, this.bottom, 0.0D).tex(this.left / texScale, (this.bottom + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.pos(this.right, this.bottom, 0.0D).tex(this.right / texScale, (this.bottom + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.pos(this.right, this.top, 0.0D).tex(this.right / texScale, (this.top + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
worldr.pos(this.left, this.top, 0.0D).tex(this.left / texScale, (this.top + (int)this.scrollDistance) / texScale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
@@ -231,22 +231,22 @@ public abstract class ScrollPanel extends FocusableGui implements IRenderable
|
||||
|
||||
RenderSystem.disableTexture();
|
||||
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
worldr.func_225582_a_(barLeft, this.bottom, 0.0D).func_225583_a_(0.0F, 1.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft + barWidth, this.bottom, 0.0D).func_225583_a_(1.0F, 1.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft + barWidth, this.top, 0.0D).func_225583_a_(1.0F, 0.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft, this.top, 0.0D).func_225583_a_(0.0F, 0.0F).func_225586_a_(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.pos(barLeft, this.bottom, 0.0D).tex(0.0F, 1.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.pos(barLeft + barWidth, this.bottom, 0.0D).tex(1.0F, 1.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.pos(barLeft + barWidth, this.top, 0.0D).tex(1.0F, 0.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
worldr.pos(barLeft, this.top, 0.0D).tex(0.0F, 0.0F).color(0x00, 0x00, 0x00, 0xFF).endVertex();
|
||||
tess.draw();
|
||||
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
worldr.func_225582_a_(barLeft, barTop + barHeight, 0.0D).func_225583_a_(0.0F, 1.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft + barWidth, barTop + barHeight, 0.0D).func_225583_a_(1.0F, 1.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft + barWidth, barTop, 0.0D).func_225583_a_(1.0F, 0.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft, barTop, 0.0D).func_225583_a_(0.0F, 0.0F).func_225586_a_(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.pos(barLeft, barTop + barHeight, 0.0D).tex(0.0F, 1.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.pos(barLeft + barWidth, barTop + barHeight, 0.0D).tex(1.0F, 1.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.pos(barLeft + barWidth, barTop, 0.0D).tex(1.0F, 0.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
worldr.pos(barLeft, barTop, 0.0D).tex(0.0F, 0.0F).color(0x80, 0x80, 0x80, 0xFF).endVertex();
|
||||
tess.draw();
|
||||
worldr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
worldr.func_225582_a_(barLeft, barTop + barHeight - 1, 0.0D).func_225583_a_(0.0F, 1.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft + barWidth - 1, barTop + barHeight - 1, 0.0D).func_225583_a_(1.0F, 1.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft + barWidth - 1, barTop, 0.0D).func_225583_a_(1.0F, 0.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.func_225582_a_(barLeft, barTop, 0.0D).func_225583_a_(0.0F, 0.0F).func_225586_a_(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.pos(barLeft, barTop + barHeight - 1, 0.0D).tex(0.0F, 1.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.pos(barLeft + barWidth - 1, barTop + barHeight - 1, 0.0D).tex(1.0F, 1.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.pos(barLeft + barWidth - 1, barTop, 0.0D).tex(1.0F, 0.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
worldr.pos(barLeft, barTop, 0.0D).tex(0.0F, 0.0F).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public class BlockModelConfiguration implements IModelConfiguration
|
||||
@Override
|
||||
public Material resolveTexture(String name)
|
||||
{
|
||||
return owner.func_228816_c_(name);
|
||||
return owner.resolveTextureName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,7 +133,7 @@ public class BlockModelConfiguration implements IModelConfiguration
|
||||
IModelTransform state = getCustomModelState();
|
||||
|
||||
return state != null
|
||||
? new SimpleModelTransform(PerspectiveMapWrapper.getTransformsWithFallback(state, getCameraTransforms()), state.func_225615_b_())
|
||||
? new SimpleModelTransform(PerspectiveMapWrapper.getTransformsWithFallback(state, getCameraTransforms()), state.getRotation())
|
||||
: new SimpleModelTransform(PerspectiveMapWrapper.getTransforms(getCameraTransforms()));
|
||||
}
|
||||
|
||||
|
||||
@@ -180,16 +180,16 @@ public class CompositeModel implements IDynamicBakedModel
|
||||
throw new UnsupportedOperationException("Attempted to call adQuads on a Submodel instance. Please don't.");
|
||||
}
|
||||
|
||||
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
{
|
||||
return model.func_225613_a_(bakery, spriteGetter, new ModelTransformComposition(this.modelTransform, modelTransform,
|
||||
return model.bakeModel(bakery, spriteGetter, new ModelTransformComposition(this.modelTransform, modelTransform,
|
||||
this.modelTransform.isUvLock() || modelTransform.isUvLock()), modelLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors)
|
||||
{
|
||||
return model.func_225614_a_(modelGetter, missingTextureErrors);
|
||||
return model.getTextures(modelGetter, missingTextureErrors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public class CompositeModel implements IDynamicBakedModel
|
||||
Submodel submodel = part.getValue();
|
||||
if (!owner.getPartVisibility(submodel))
|
||||
continue;
|
||||
bakedParts.put(part.getKey(), submodel.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation));
|
||||
bakedParts.put(part.getKey(), submodel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation));
|
||||
}
|
||||
return new CompositeModel(owner.isShadedInGui(), owner.useSmoothLighting(), particle, bakedParts.build(), owner.getCombinedTransform(), overrides);
|
||||
}
|
||||
|
||||
@@ -97,25 +97,25 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
|
||||
{
|
||||
Material particleLocation = owner.resolveTexture("particle");
|
||||
if (MissingTextureSprite.getLocation().equals(particleLocation.func_229313_b_()))
|
||||
if (MissingTextureSprite.getLocation().equals(particleLocation.getTextureLocation()))
|
||||
{
|
||||
particleLocation = null;
|
||||
}
|
||||
|
||||
Material baseLocation = owner.resolveTexture("base");
|
||||
if (MissingTextureSprite.getLocation().equals(baseLocation.func_229313_b_()))
|
||||
if (MissingTextureSprite.getLocation().equals(baseLocation.getTextureLocation()))
|
||||
{
|
||||
baseLocation = null;
|
||||
}
|
||||
|
||||
Material fluidMaskLocation = owner.resolveTexture("fluid");
|
||||
if (MissingTextureSprite.getLocation().equals(fluidMaskLocation.func_229313_b_()))
|
||||
if (MissingTextureSprite.getLocation().equals(fluidMaskLocation.getTextureLocation()))
|
||||
{
|
||||
fluidMaskLocation = null;
|
||||
}
|
||||
|
||||
Material coverLocation = owner.resolveTexture("cover");
|
||||
if (!MissingTextureSprite.getLocation().equals(coverLocation.func_229313_b_()))
|
||||
if (!MissingTextureSprite.getLocation().equals(coverLocation.getTextureLocation()))
|
||||
{
|
||||
// cover (the actual item around the other two)
|
||||
coverLocation = null;
|
||||
@@ -135,7 +135,7 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
|
||||
modelTransform = new ModelTransformComposition(modelTransform, new SimpleModelTransform(new TransformationMatrix(null, new Quaternion(0, 0, 1, 0), null, null)));
|
||||
}
|
||||
|
||||
TransformationMatrix transform = modelTransform.func_225615_b_();
|
||||
TransformationMatrix transform = modelTransform.getRotation();
|
||||
|
||||
TextureAtlasSprite fluidSprite = fluid != Fluids.EMPTY ? spriteGetter.apply(ForgeHooksClient.getBlockMaterial(fluid.getAttributes().getStillTexture())) : null;
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> func_225614_a_(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
|
||||
public Collection<Material> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String, String>> missingTextureErrors)
|
||||
{
|
||||
return ImmutableList.of(font2);
|
||||
}
|
||||
@@ -104,11 +104,11 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
{
|
||||
IBakedModel bigMissing = missingModel.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation);
|
||||
IBakedModel bigMissing = missingModel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation);
|
||||
ModelTransformComposition smallState = new ModelTransformComposition(modelTransform, new SimpleModelTransform(smallTransformation));
|
||||
IBakedModel smallMissing = missingModel.func_225613_a_(bakery, spriteGetter, smallState, modelLocation);
|
||||
IBakedModel smallMissing = missingModel.bakeModel(bakery, spriteGetter, smallState, modelLocation);
|
||||
return new BakedModel(bigMissing, smallMissing, fontRenderer, message, spriteGetter.apply(font2));
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
@Override
|
||||
public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack mat)
|
||||
{
|
||||
TransformationMatrix transform = TransformationMatrix.func_227983_a_();
|
||||
TransformationMatrix transform = TransformationMatrix.identity();
|
||||
boolean big = true;
|
||||
switch (cameraTransformType)
|
||||
{
|
||||
@@ -235,7 +235,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
default:
|
||||
break;
|
||||
}
|
||||
mat.func_227866_c_().func_227870_a_().func_226595_a_(transform.func_227988_c_());
|
||||
mat.getLast().getMatrix().mul(transform.getMatrix());
|
||||
if (big != this.big)
|
||||
{
|
||||
return otherModel;
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class FluidModel implements IModelGeometry<FluidModel>
|
||||
{
|
||||
FluidAttributes attrs = fluid.getAttributes();
|
||||
return new CachingBakedFluid(
|
||||
modelTransform.func_225615_b_(),
|
||||
modelTransform.getRotation(),
|
||||
PerspectiveMapWrapper.getTransforms(modelTransform),
|
||||
modelLocation,
|
||||
attrs.getColor(),
|
||||
@@ -389,7 +389,7 @@ public final class FluidModel implements IModelGeometry<FluidModel>
|
||||
private void putVertex(IVertexConsumer consumer, Direction side, boolean offset, float x, float y, float z, float u, float v)
|
||||
{
|
||||
VertexFormat format = DefaultVertexFormats.BLOCK;
|
||||
ImmutableList<VertexFormatElement> elements = format.func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> elements = format.getElements();
|
||||
for(int e = 0; e < elements.size(); e++)
|
||||
{
|
||||
switch(elements.get(e).getUsage())
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
|
||||
{
|
||||
//TODO: Verify
|
||||
TransformationMatrix transform = modelTransform.func_225615_b_();
|
||||
TransformationMatrix transform = modelTransform.getRotation();
|
||||
ImmutableList<BakedQuad> quads = getQuadsForSprites(textures, transform, spriteGetter);
|
||||
TextureAtlasSprite particle = spriteGetter.apply(
|
||||
owner.isTexturePresent("particle") ? owner.resolveTexture("particle") : textures.get(0)
|
||||
@@ -396,9 +396,9 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
|
||||
private static void putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v)
|
||||
{
|
||||
VertexFormat format = consumer.getVertexFormat();
|
||||
for(int e = 0; e < format.func_227894_c_().size(); e++)
|
||||
for(int e = 0; e < format.getElements().size(); e++)
|
||||
{
|
||||
switch(format.func_227894_c_().get(e).getUsage())
|
||||
switch(format.getElements().get(e).getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
consumer.put(e, x, y, z, 1f);
|
||||
@@ -413,7 +413,7 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
|
||||
consumer.put(e, offX, offY, offZ, 0f);
|
||||
break;
|
||||
case UV:
|
||||
if(format.func_227894_c_().get(e).getIndex() == 0)
|
||||
if(format.getElements().get(e).getIndex() == 0)
|
||||
{
|
||||
consumer.put(e, u, v, 0f, 1f);
|
||||
break;
|
||||
|
||||
@@ -264,9 +264,9 @@ public final class ItemTextureQuadConverter
|
||||
float x, float y, float z, float u, float v, int color)
|
||||
{
|
||||
VertexFormat format = consumer.getVertexFormat();
|
||||
for (int e = 0; e < format.func_227894_c_().size(); e++)
|
||||
for (int e = 0; e < format.getElements().size(); e++)
|
||||
{
|
||||
switch (format.func_227894_c_().get(e).getUsage())
|
||||
switch (format.getElements().get(e).getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
consumer.put(e, x, y, z, 1f);
|
||||
@@ -285,7 +285,7 @@ public final class ItemTextureQuadConverter
|
||||
consumer.put(e, offX, offY, offZ, 0f);
|
||||
break;
|
||||
case UV:
|
||||
if (format.func_227894_c_().get(e).getIndex() == 0)
|
||||
if (format.getElements().get(e).getIndex() == 0)
|
||||
{
|
||||
consumer.put(e, u, v, 0f, 1f);
|
||||
break;
|
||||
|
||||
@@ -65,11 +65,11 @@ public final class ModelLoader extends ModelBakery
|
||||
return isLoading;
|
||||
}
|
||||
|
||||
public ModelLoader(IResourceManager manager, BlockColors colours, IProfiler profiler, int p_i226056_4_)
|
||||
public ModelLoader(IResourceManager manager, BlockColors colours, IProfiler profiler, int maxMipmapLevel)
|
||||
{
|
||||
super(manager, colours, false);
|
||||
instance = this;
|
||||
processLoading(profiler, p_i226056_4_);
|
||||
processLoading(profiler, maxMipmapLevel);
|
||||
}
|
||||
|
||||
private static Set<ResourceLocation> specialModels = new HashSet<>();
|
||||
@@ -162,7 +162,7 @@ public final class ModelLoader extends ModelBakery
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, LOCATION).func_229314_c_();
|
||||
instance = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, LOCATION).getSprite();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public final class ModelLoader extends ModelBakery
|
||||
*/
|
||||
public static Function<Material, TextureAtlasSprite> defaultTextureGetter()
|
||||
{
|
||||
return Material::func_229314_c_;
|
||||
return Material::getSprite;
|
||||
}
|
||||
|
||||
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
|
||||
|
||||
@@ -219,15 +219,15 @@ public class ModelLoaderRegistry
|
||||
if(transform.has("rotation")) k--;
|
||||
if(transform.has("scale")) k--;
|
||||
if(transform.has("post-rotation")) k--;
|
||||
if(transform.has("origin")) k--;
|
||||
if(k > 0)
|
||||
{
|
||||
throw new JsonParseException("transform: allowed keys: 'thirdperson', 'firstperson', 'gui', 'head', 'matrix', 'translation', 'rotation', 'scale', 'post-rotation'");
|
||||
throw new JsonParseException("transform: allowed keys: 'thirdperson', 'firstperson', 'gui', 'head', 'matrix', 'translation', 'rotation', 'scale', 'post-rotation', 'origin'");
|
||||
}
|
||||
TransformationMatrix base = TransformationMatrix.func_227983_a_();
|
||||
TransformationMatrix base = TransformationMatrix.identity();
|
||||
if(!transform.entrySet().isEmpty())
|
||||
{
|
||||
base = context.deserialize(transform, TransformationMatrix.class);
|
||||
base = base.blockCenterToCorner();
|
||||
}
|
||||
IModelTransform state = new SimpleModelTransform(Maps.immutableEnumMap(transforms), base);
|
||||
return Optional.of(state);
|
||||
@@ -249,7 +249,7 @@ public class ModelLoaderRegistry
|
||||
IModelGeometry<?> customModel = blockModel.customData.getCustomGeometry();
|
||||
IModelTransform customModelState = blockModel.customData.getCustomModelState();
|
||||
if (customModelState != null)
|
||||
modelTransform = new ModelTransformComposition(customModelState, modelTransform, modelTransform.isUvLock());
|
||||
modelTransform = new ModelTransformComposition(modelTransform, customModelState, modelTransform.isUvLock());
|
||||
|
||||
if (customModel != null)
|
||||
model = customModel.bake(blockModel.customData, modelBakery, spriteGetter, modelTransform, blockModel.getOverrides(modelBakery, otherModel, spriteGetter), modelLocation);
|
||||
@@ -282,7 +282,7 @@ public class ModelLoaderRegistry
|
||||
modelBuilder.addGeneralQuad(BlockModel.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, modelTransform, modelLocation));
|
||||
} else {
|
||||
modelBuilder.addFaceQuad(
|
||||
modelTransform.func_225615_b_().rotateTransform(blockpartface.cullFace),
|
||||
modelTransform.getRotation().rotateTransform(blockpartface.cullFace),
|
||||
BlockModel.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, modelTransform, modelLocation));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,9 +51,9 @@ public class ModelTransformComposition implements IModelTransform
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformationMatrix func_225615_b_()
|
||||
public TransformationMatrix getRotation()
|
||||
{
|
||||
return first.func_225615_b_().compose(second.func_225615_b_());
|
||||
return first.getRotation().compose(second.getRotation());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loaded 100 of 259 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user