mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 09:05:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
949984268d | ||
|
|
114acfca3b | ||
|
|
56e538e8a9 | ||
|
|
fa46f3dd49 | ||
|
|
6ec5a8f2c1 | ||
|
|
49b596dda3 | ||
|
|
0c5ced1bbf | ||
|
|
4a09a2420d | ||
|
|
0ff8a596fc | ||
|
|
bca20ace4e | ||
|
|
f3b53001c9 | ||
|
|
15bac0eeaa | ||
|
|
1782973a29 | ||
|
|
9a4a501a95 | ||
|
|
9bbfbd5479 | ||
|
|
8c68731838 | ||
|
|
0d7f507f4e | ||
|
|
f78b943bdf | ||
|
|
160f3f88f9 | ||
|
|
45e38859ed | ||
|
|
38a5400a8c | ||
|
|
acd18455c2 | ||
|
|
5a7facc20f | ||
|
|
f54998a6b7 | ||
|
|
7d00d015f3 | ||
|
|
fed7beab89 | ||
|
|
cf3e9d1e0c | ||
|
|
749c9063af | ||
|
|
1af6632a29 | ||
|
|
7e79243bca | ||
|
|
36f9c804d9 | ||
|
|
06fe9ccda0 | ||
|
|
53eedb0f10 | ||
|
|
6e0e67b14d | ||
|
|
22f7f4649b | ||
|
|
8a77681574 | ||
|
|
6982c5dd56 | ||
|
|
7205c30ece | ||
|
|
80baad974e | ||
|
|
ae160cad12 | ||
|
|
6ff6277efa | ||
|
|
74f9ef838a | ||
|
|
395f89c973 | ||
|
|
8536521b7b | ||
|
|
b1659300e0 | ||
|
|
93226bbcff | ||
|
|
51fa230e7b | ||
|
|
5f292895cb | ||
|
|
9cfe741cea | ||
|
|
bed38d4253 | ||
|
|
37f226eda5 | ||
|
|
59b4affbe7 | ||
|
|
5477a36656 | ||
|
|
5648336893 | ||
|
|
f5b53d5d10 | ||
|
|
10448c1ac9 | ||
|
|
5243275db2 | ||
|
|
3041c2022b | ||
|
|
09be003d61 | ||
|
|
3fe5ddd68f | ||
|
|
935cb6782d | ||
|
|
9b421b54a7 | ||
|
|
6e23030595 | ||
|
|
78d69db79e | ||
|
|
9177ac1b2e | ||
|
|
248d207dbc |
No files matched your search
+14
-12
@@ -10,7 +10,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.179'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.187'
|
||||
classpath 'org.ow2.asm:asm:7.2'
|
||||
classpath 'org.ow2.asm:asm-tree:7.2'
|
||||
}
|
||||
@@ -53,9 +53,9 @@ ext {
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'snapshot'
|
||||
MAPPING_VERSION = '20200514-1.16'
|
||||
MC_VERSION = '1.16.3'
|
||||
MCP_VERSION = '20200911.084530'
|
||||
MAPPING_VERSION = '20201028-1.16.3'
|
||||
MC_VERSION = '1.16.4'
|
||||
MCP_VERSION = '20201102.104115'
|
||||
}
|
||||
|
||||
project(':mcp') {
|
||||
@@ -197,7 +197,7 @@ project(':forge') {
|
||||
}
|
||||
|
||||
ext {
|
||||
SPEC_VERSION = '34.1' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
SPEC_VERSION = '35.1' // 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.
|
||||
@@ -353,8 +353,10 @@ project(':forge') {
|
||||
'--mod', 'global_loot_test',
|
||||
'--mod', 'scaffolding_test',
|
||||
'--mod', 'custom_tag_types_test',
|
||||
'--mod', 'new_model_loader_test',
|
||||
'--output', rootProject.file('src/generated_test/resources/'),
|
||||
'--existing', sourceSets.main.resources.srcDirs[0]
|
||||
'--existing', sourceSets.main.resources.srcDirs[0],
|
||||
'--existing', sourceSets.test.resources.srcDirs[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,11 +437,11 @@ project(':forge') {
|
||||
installer 'org.ow2.asm:asm-tree:7.2'
|
||||
installer 'org.ow2.asm:asm-util:7.2'
|
||||
installer 'org.ow2.asm:asm-analysis:7.2'
|
||||
installer 'cpw.mods:modlauncher:7.0.+'
|
||||
installer 'cpw.mods:modlauncher:8.0.6'
|
||||
installer 'cpw.mods:grossjava9hacks:1.3.+'
|
||||
installer 'net.minecraftforge:accesstransformers:2.2.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:3.0.+:service'
|
||||
installer 'net.minecraftforge:forgespi:3.1.+'
|
||||
installer 'net.minecraftforge:forgespi:3.2.+'
|
||||
installer 'net.minecraftforge:coremods:3.0.+'
|
||||
installer 'net.minecraftforge:unsafe:0.2.+'
|
||||
installer 'com.electronwill.night-config:core:3.6.2'
|
||||
@@ -451,7 +453,7 @@ project(':forge') {
|
||||
installer 'org.apache.logging.log4j:log4j-core:2.11.2'
|
||||
installer 'net.minecrell:terminalconsoleappender:1.2.+'
|
||||
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
|
||||
installer 'org.spongepowered:mixin:0.8.1'
|
||||
installer 'org.spongepowered:mixin:0.8.2'
|
||||
fmllauncherImplementation 'com.google.guava:guava:21.0'
|
||||
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
|
||||
fmllauncherImplementation 'org.lwjgl:lwjgl:3.2.2'
|
||||
@@ -877,7 +879,9 @@ project(':forge') {
|
||||
FORGE_NAME: project.name,
|
||||
MC_VERSION: MC_VERSION,
|
||||
MAPPING_CHANNEL: MAPPING_CHANNEL,
|
||||
MAPPING_VERSION: MAPPING_VERSION
|
||||
MAPPING_VERSION: MAPPING_VERSION,
|
||||
FORGE_SPEC_VERSION: SPEC_VERSION.split("\\.")[0],
|
||||
MC_NEXT_VERSION: "1."+((MC_VERSION.split("\\.")[1] as int)+1)
|
||||
])
|
||||
rename 'gitignore\\.txt', '.gitignore'
|
||||
rename 'gitattributes\\.txt', '.gitattributes'
|
||||
@@ -1062,5 +1066,3 @@ task setup() {
|
||||
dependsOn ':clean:extractMapped'
|
||||
dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
|
||||
}
|
||||
|
||||
|
||||
@@ -21,31 +21,44 @@ public class CheckSAS extends DefaultTask {
|
||||
sass.each { f ->
|
||||
def lines = []
|
||||
f.eachLine { line ->
|
||||
if (line[0] == '\t') return //Skip any tabed lines, those are ones we add
|
||||
if (line[0] == '\t') return //Skip any tabbed lines, those are ones we add
|
||||
def idx = line.indexOf('#')
|
||||
if (idx == 0 || line.isEmpty()) {
|
||||
lines.add(line)
|
||||
return
|
||||
}
|
||||
|
||||
def comment = idx == -1 ? null : line.substring(idx)
|
||||
if (idx != -1) line = line.substring(0, idx - 1)
|
||||
|
||||
def (cls, desc) = (line.trim() + ' ').split(' ', -1)
|
||||
cls = cls.replaceAll('\\.', '/')
|
||||
desc = desc.replace('(', ' (')
|
||||
if (desc.isEmpty() || json[cls] == null || json[cls]['methods'] == null || json[cls]['methods'][desc] == null) {
|
||||
|
||||
if (json[cls] == null || (!desc.isEmpty() && (json[cls]['methods'] == null || json[cls]['methods'][desc] == null))) {
|
||||
println('Invalid: ' + line)
|
||||
return
|
||||
}
|
||||
|
||||
def mtd = json[cls]['methods'][desc]
|
||||
|
||||
//Class SAS
|
||||
if (desc.isEmpty()) {
|
||||
lines.add(cls + (comment == null ? '' : ' ' + comment))
|
||||
if (json[cls]['methods'] != null)
|
||||
(json[cls]['methods'] as TreeMap).each {
|
||||
findChildMethods(json, cls, it.key).each { lines.add('\t' + it) }
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//Method SAS
|
||||
lines.add(cls + ' ' + desc.replace(' ', '') + (comment == null ? '' : ' ' + comment))
|
||||
def children = json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls}
|
||||
.collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
|
||||
children.each { lines.add('\t' + it) }
|
||||
findChildMethods(json, cls, desc).each { lines.add('\t' + it) }
|
||||
}
|
||||
f.text = lines.join('\n')
|
||||
}
|
||||
}
|
||||
|
||||
protected static findChildMethods(json, cls, desc)
|
||||
{
|
||||
return json.values().findAll{ it.methods != null && it.methods[desc] != null && it.methods[desc].override == cls}
|
||||
.collect { it.name + ' ' + desc.replace(' ', '') } as TreeSet
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<img src="assets/Forge_logo.svg">
|
||||

|
||||
|
||||
MinecraftForge
|
||||
=============
|
||||
|
||||
+5
-1
@@ -75,7 +75,8 @@ minecraft {
|
||||
// Recommended logging level for the console
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
|
||||
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
||||
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
|
||||
mods {
|
||||
examplemod {
|
||||
@@ -86,6 +87,9 @@ minecraft {
|
||||
}
|
||||
}
|
||||
|
||||
// Include resources generated by data generators.
|
||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||
|
||||
dependencies {
|
||||
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader="javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[34,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
loaderVersion="[@FORGE_SPEC_VERSION@,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
||||
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
||||
license="All rights reserved"
|
||||
@@ -17,6 +17,8 @@ issueTrackerURL="http://my.issue.tracker/" #optional
|
||||
# The modid of the mod
|
||||
modId="examplemod" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
|
||||
# see the associated build.gradle script for how to populate this completely automatically during a build
|
||||
version="${file.jarVersion}" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="Example Mod" #mandatory
|
||||
@@ -45,7 +47,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[34,)" #mandatory
|
||||
versionRange="[@FORGE_SPEC_VERSION@,)" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
@@ -54,6 +56,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
|
||||
[[dependencies.examplemod]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.16.3]"
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange="[@MC_VERSION@,@MC_NEXT_VERSION@)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
@@ -556,10 +556,17 @@
|
||||
@@ -572,10 +572,17 @@
|
||||
GL13.glClientActiveTexture(p_227747_0_);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
}
|
||||
|
||||
public static Advancement.Builder func_241043_a_(JsonObject p_241043_0_, ConditionArrayParser p_241043_1_) {
|
||||
+ if (!net.minecraftforge.common.crafting.ConditionalAdvancement.processConditions(p_241043_0_)) return null;
|
||||
+ if ((p_241043_0_ = net.minecraftforge.common.crafting.ConditionalAdvancement.processConditional(p_241043_0_)) == null) return null;
|
||||
ResourceLocation resourcelocation = p_241043_0_.has("parent") ? new ResourceLocation(JSONUtils.func_151200_h(p_241043_0_, "parent")) : null;
|
||||
DisplayInfo displayinfo = p_241043_0_.has("display") ? DisplayInfo.func_192294_a(JSONUtils.func_152754_s(p_241043_0_, "display")) : null;
|
||||
AdvancementRewards advancementrewards = p_241043_0_.has("rewards") ? AdvancementRewards.func_241096_a_(JSONUtils.func_152754_s(p_241043_0_, "rewards")) : AdvancementRewards.field_192114_a;
|
||||
@@ -65,10 +65,14 @@
|
||||
}
|
||||
|
||||
return this.field_220085_g;
|
||||
@@ -346,6 +349,10 @@
|
||||
@@ -346,6 +349,14 @@
|
||||
return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P());
|
||||
}
|
||||
|
||||
+ protected boolean isAir(BlockState state) {
|
||||
+ return ((AbstractBlockState)state).field_235702_f_;
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE START ===================================== */
|
||||
+ private final java.util.function.Supplier<ResourceLocation> lootTableSupplier;
|
||||
+ /* ========================================= FORGE END ====================================== */
|
||||
@@ -76,16 +80,18 @@
|
||||
public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> {
|
||||
private final int field_215708_d;
|
||||
private final boolean field_215709_e;
|
||||
@@ -428,6 +435,8 @@
|
||||
@@ -428,14 +439,18 @@
|
||||
return this.field_215708_d;
|
||||
}
|
||||
|
||||
+ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */
|
||||
+ @Deprecated
|
||||
public boolean func_196958_f() {
|
||||
return this.field_235702_f_;
|
||||
- return this.field_235702_f_;
|
||||
+ return this.func_177230_c().isAir((BlockState)this);
|
||||
}
|
||||
@@ -436,6 +445,8 @@
|
||||
|
||||
public MaterialColor func_185909_g(IBlockReader p_185909_1_, BlockPos p_185909_2_) {
|
||||
return this.field_235704_h_;
|
||||
}
|
||||
|
||||
@@ -94,7 +100,7 @@
|
||||
public BlockState func_185907_a(Rotation p_185907_1_) {
|
||||
return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_);
|
||||
}
|
||||
@@ -802,6 +813,9 @@
|
||||
@@ -802,6 +817,9 @@
|
||||
private ResourceLocation field_222381_j;
|
||||
private boolean field_226895_m_ = true;
|
||||
private boolean field_235813_o_;
|
||||
@@ -104,7 +110,7 @@
|
||||
private AbstractBlock.IExtendedPositionPredicate<EntityType<?>> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> {
|
||||
return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14;
|
||||
};
|
||||
@@ -863,6 +877,8 @@
|
||||
@@ -863,6 +881,8 @@
|
||||
abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_;
|
||||
abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_;
|
||||
abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_;
|
||||
@@ -113,7 +119,7 @@
|
||||
return abstractblock$properties;
|
||||
}
|
||||
|
||||
@@ -877,6 +893,24 @@
|
||||
@@ -877,6 +897,24 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -138,7 +144,7 @@
|
||||
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
|
||||
this.field_200961_i = p_200941_1_;
|
||||
return this;
|
||||
@@ -933,7 +967,7 @@
|
||||
@@ -933,7 +971,7 @@
|
||||
}
|
||||
|
||||
public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
|
||||
|
||||
@@ -9,3 +9,12 @@
|
||||
if (flag && !p_220066_2_.func_177229_b(field_220101_b) && !p_220066_2_.func_177229_b(field_220103_d)) {
|
||||
BlockPos blockpos = p_220066_3_.func_216350_a();
|
||||
p_220066_1_.func_180501_a(blockpos, p_220066_2_.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)), 11);
|
||||
@@ -208,7 +208,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
- boolean flag = VoxelShapes.func_197879_c(field_226912_f_, blockstate.func_215685_b(p_235474_0_, p_235474_1_, ISelectionContext.func_216377_a()), IBooleanFunction.field_223238_i_);
|
||||
+ boolean flag = VoxelShapes.func_197879_c(field_226912_f_, blockstate.func_215685_b(p_235474_0_, blockpos, ISelectionContext.func_216377_a()), IBooleanFunction.field_223238_i_);//Forge fix: MC-201374
|
||||
if (flag) {
|
||||
BlockState blockstate1 = p_235474_0_.func_180495_p(blockpos.func_177977_b());
|
||||
return func_226915_i_(blockstate1);
|
||||
@@ -20,7 +20,7 @@
|
||||
+ * flower pots from altering vanilla behavior.
|
||||
+ *
|
||||
+ * @param emptyPot The empty pot for this pot, or null for self.
|
||||
+ * @param p_i48395_1_ The flower block.
|
||||
+ * @param block The flower block.
|
||||
+ * @param properties
|
||||
+ */
|
||||
+ public FlowerPotBlock(@javax.annotation.Nullable java.util.function.Supplier<FlowerPotBlock> emptyPot, java.util.function.Supplier<? extends Block> p_i48395_1_, AbstractBlock.Properties properties) {
|
||||
|
||||
@@ -26,16 +26,19 @@
|
||||
Direction direction3 = direction.func_176746_e();
|
||||
Direction direction4 = direction.func_176735_f();
|
||||
boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3));
|
||||
@@ -216,7 +216,7 @@
|
||||
@@ -216,8 +216,9 @@
|
||||
if (p_225542_3_.func_177956_o() > 0) {
|
||||
BlockPos blockpos1 = p_225542_3_.func_177977_b();
|
||||
BlockState blockstate = p_225542_2_.func_180495_p(blockpos1);
|
||||
- if (blockstate.func_196958_f() || blockstate.func_203425_a(this)) {
|
||||
+ if (blockstate.isAir(p_225542_2_, blockpos) || blockstate.func_203425_a(this)) {
|
||||
BlockState blockstate1 = blockstate.func_196958_f() ? this.func_176223_P() : blockstate;
|
||||
- BlockState blockstate1 = blockstate.func_196958_f() ? this.func_176223_P() : blockstate;
|
||||
+ boolean isAir = blockstate.isAir(p_225542_2_, blockpos1);
|
||||
+ if (isAir || blockstate.func_203425_a(this)) {
|
||||
+ BlockState blockstate1 = isAir ? this.func_176223_P() : blockstate;
|
||||
BlockState blockstate2 = this.func_196544_a(p_225542_1_, blockstate1, p_225542_4_);
|
||||
if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) {
|
||||
@@ -322,4 +322,7 @@
|
||||
p_225542_2_.func_180501_a(blockpos1, blockstate2, 2);
|
||||
@@ -322,4 +323,7 @@
|
||||
public static BooleanProperty func_176267_a(Direction p_176267_0_) {
|
||||
return field_196546_A.get(p_176267_0_);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/GameSettings.java
|
||||
+++ b/net/minecraft/client/GameSettings.java
|
||||
@@ -167,6 +167,7 @@
|
||||
@@ -170,6 +170,7 @@
|
||||
public boolean field_241568_aS_;
|
||||
|
||||
public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
|
||||
@@ -8,7 +8,7 @@
|
||||
this.field_74317_L = p_i46326_1_;
|
||||
this.field_74354_ai = new File(p_i46326_2_, "options.txt");
|
||||
if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
|
||||
@@ -518,7 +519,11 @@
|
||||
@@ -529,7 +530,11 @@
|
||||
|
||||
for(KeyBinding keybinding : this.field_74324_K) {
|
||||
if (s.equals("key_" + keybinding.func_151464_g())) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,6 +570,7 @@
|
||||
@@ -576,6 +581,7 @@
|
||||
}
|
||||
|
||||
public void func_74303_b() {
|
||||
@@ -29,7 +29,7 @@
|
||||
try (PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.field_74354_ai), StandardCharsets.UTF_8))) {
|
||||
printwriter.println("version:" + SharedConstants.func_215069_a().getWorldVersion());
|
||||
printwriter.println("autoJump:" + AbstractOption.field_216719_z.func_216741_b(this));
|
||||
@@ -648,7 +654,7 @@
|
||||
@@ -661,7 +667,7 @@
|
||||
printwriter.println("syncChunkWrites:" + this.field_241568_aS_);
|
||||
|
||||
for(KeyBinding keybinding : this.field_74324_K) {
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
for(SoundCategory soundcategory : SoundCategory.values()) {
|
||||
@@ -747,6 +753,23 @@
|
||||
@@ -760,6 +766,23 @@
|
||||
p_198017_1_.func_198985_a(set);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/Minecraft.java
|
||||
+++ b/net/minecraft/client/Minecraft.java
|
||||
@@ -357,6 +357,7 @@
|
||||
@@ -368,6 +368,7 @@
|
||||
public Minecraft(GameConfiguration p_i45547_1_) {
|
||||
super("Client");
|
||||
field_71432_P = this;
|
||||
@@ -8,15 +8,15 @@
|
||||
this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
|
||||
File file1 = p_i45547_1_.field_178744_c.field_178759_c;
|
||||
this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
|
||||
@@ -369,7 +370,6 @@
|
||||
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
@@ -382,7 +383,6 @@
|
||||
this.field_244734_au = this.func_244735_a(yggdrasilauthenticationservice, p_i45547_1_);
|
||||
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
|
||||
field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a());
|
||||
- field_147123_G.debug("(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
|
||||
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
|
||||
this.field_238175_ae_ = !p_i45547_1_.field_178741_d.field_239099_d_;
|
||||
this.field_238176_af_ = !p_i45547_1_.field_178741_d.field_239100_e_;
|
||||
@@ -415,13 +415,13 @@
|
||||
@@ -428,13 +428,13 @@
|
||||
|
||||
this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i);
|
||||
this.field_71417_B = new MouseHelper(this);
|
||||
@@ -31,7 +31,7 @@
|
||||
this.field_110448_aq.func_198983_a();
|
||||
this.field_71474_y.func_198017_a(this.field_110448_aq);
|
||||
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
|
||||
@@ -462,6 +462,7 @@
|
||||
@@ -476,6 +476,7 @@
|
||||
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);
|
||||
@@ -39,7 +39,7 @@
|
||||
this.field_110451_am.func_219534_a(this.field_71452_i);
|
||||
this.field_213272_aL = new PaintingSpriteUploader(this.field_71446_o);
|
||||
this.field_110451_am.func_219534_a(this.field_213272_aL);
|
||||
@@ -469,7 +470,8 @@
|
||||
@@ -483,7 +484,8 @@
|
||||
this.field_110451_am.func_219534_a(this.field_213273_aM);
|
||||
this.field_241557_ar_ = new GPUWarning();
|
||||
this.field_110451_am.func_219534_a(this.field_241557_ar_);
|
||||
@@ -49,7 +49,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()) {
|
||||
@@ -481,11 +483,6 @@
|
||||
@@ -495,11 +497,6 @@
|
||||
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();
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
ResourceLoadProgressGui.func_212970_a(this);
|
||||
List<IResourcePack> list = this.field_110448_aq.func_232623_f_();
|
||||
@@ -494,7 +491,14 @@
|
||||
@@ -508,7 +505,14 @@
|
||||
if (SharedConstants.field_206244_b) {
|
||||
this.func_213256_aB();
|
||||
}
|
||||
@@ -77,7 +77,7 @@
|
||||
});
|
||||
}, false));
|
||||
}
|
||||
@@ -533,7 +537,7 @@
|
||||
@@ -556,7 +560,7 @@
|
||||
}
|
||||
|
||||
private void func_229988_a_(Throwable p_229988_1_) {
|
||||
@@ -86,7 +86,7 @@
|
||||
ITextComponent itextcomponent;
|
||||
if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) {
|
||||
itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_241203_a().func_195762_a());
|
||||
@@ -621,7 +625,7 @@
|
||||
@@ -644,7 +648,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_) -> {
|
||||
@@ -95,7 +95,7 @@
|
||||
});
|
||||
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
|
||||
|
||||
@@ -691,13 +695,13 @@
|
||||
@@ -714,13 +718,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());
|
||||
@@ -112,7 +112,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -706,6 +710,7 @@
|
||||
@@ -729,6 +733,7 @@
|
||||
return this.field_71474_y.field_211842_aO;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
public CompletableFuture<Void> func_213237_g() {
|
||||
if (this.field_213276_aV != null) {
|
||||
return this.field_213276_aV;
|
||||
@@ -794,10 +799,6 @@
|
||||
@@ -817,10 +822,6 @@
|
||||
}
|
||||
|
||||
public void func_147108_a(@Nullable Screen p_147108_1_) {
|
||||
@@ -131,7 +131,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_233643_dh_()) {
|
||||
@@ -808,6 +809,14 @@
|
||||
@@ -831,6 +832,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,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);
|
||||
@@ -939,11 +948,13 @@
|
||||
@@ -962,11 +971,13 @@
|
||||
RenderSystem.enableCull();
|
||||
this.field_71424_I.func_76319_b();
|
||||
if (!this.field_71454_w) {
|
||||
@@ -160,7 +160,7 @@
|
||||
}
|
||||
|
||||
if (this.field_238174_aV_ != null) {
|
||||
@@ -1042,6 +1053,7 @@
|
||||
@@ -1065,6 +1076,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);
|
||||
@@ -168,7 +168,7 @@
|
||||
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();
|
||||
}
|
||||
@@ -1230,11 +1242,21 @@
|
||||
@@ -1253,11 +1265,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();
|
||||
@@ -192,7 +192,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1253,6 +1275,8 @@
|
||||
@@ -1276,6 +1298,8 @@
|
||||
}
|
||||
|
||||
} else if (!this.field_71439_g.func_184838_M()) {
|
||||
@@ -201,7 +201,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());
|
||||
@@ -1260,7 +1284,7 @@
|
||||
@@ -1283,7 +1307,7 @@
|
||||
case BLOCK:
|
||||
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
|
||||
BlockPos blockpos = blockraytraceresult.func_216350_a();
|
||||
@@ -210,7 +210,7 @@
|
||||
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
|
||||
break;
|
||||
}
|
||||
@@ -1270,8 +1294,10 @@
|
||||
@@ -1293,8 +1317,10 @@
|
||||
}
|
||||
|
||||
this.field_71439_g.func_184821_cY();
|
||||
@@ -221,7 +221,7 @@
|
||||
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1286,6 +1312,11 @@
|
||||
@@ -1309,6 +1335,11 @@
|
||||
}
|
||||
|
||||
for(Hand hand : Hand.values()) {
|
||||
@@ -233,7 +233,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()) {
|
||||
@@ -1299,6 +1330,7 @@
|
||||
@@ -1322,6 +1353,7 @@
|
||||
|
||||
if (actionresulttype.func_226246_a_()) {
|
||||
if (actionresulttype.func_226247_b_()) {
|
||||
@@ -241,7 +241,7 @@
|
||||
this.field_71439_g.func_184609_a(hand);
|
||||
}
|
||||
|
||||
@@ -1311,6 +1343,7 @@
|
||||
@@ -1334,6 +1366,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_()) {
|
||||
@@ -249,7 +249,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);
|
||||
@@ -1326,6 +1359,9 @@
|
||||
@@ -1349,6 +1382,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,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_()) {
|
||||
@@ -1352,6 +1388,8 @@
|
||||
@@ -1375,6 +1411,8 @@
|
||||
--this.field_71467_ac;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
this.field_71424_I.func_76320_a("gui");
|
||||
if (!this.field_71445_n) {
|
||||
this.field_71456_v.func_73831_a();
|
||||
@@ -1468,6 +1506,8 @@
|
||||
@@ -1500,6 +1538,8 @@
|
||||
this.field_71424_I.func_219895_b("keyboard");
|
||||
this.field_195559_v.func_204870_b();
|
||||
this.field_71424_I.func_76319_b();
|
||||
@@ -276,8 +276,8 @@
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostClientTick();
|
||||
}
|
||||
|
||||
private void func_184117_aA() {
|
||||
@@ -1697,7 +1737,12 @@
|
||||
private boolean func_244600_aM() {
|
||||
@@ -1747,7 +1787,12 @@
|
||||
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_229998_0_) -> {
|
||||
}));
|
||||
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
|
||||
@@ -291,7 +291,7 @@
|
||||
this.field_71453_ak = networkmanager;
|
||||
} else {
|
||||
this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> {
|
||||
@@ -1771,6 +1816,7 @@
|
||||
@@ -1821,6 +1866,7 @@
|
||||
}
|
||||
|
||||
public void func_71403_a(ClientWorld p_71403_1_) {
|
||||
@@ -299,7 +299,7 @@
|
||||
WorkingScreen workingscreen = new WorkingScreen();
|
||||
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
|
||||
this.func_213241_c(workingscreen);
|
||||
@@ -1802,10 +1848,12 @@
|
||||
@@ -1852,10 +1898,12 @@
|
||||
IntegratedServer integratedserver = this.field_71437_Z;
|
||||
this.field_71437_Z = null;
|
||||
this.field_71460_t.func_190564_k();
|
||||
@@ -312,7 +312,7 @@
|
||||
if (integratedserver != null) {
|
||||
this.field_71424_I.func_76320_a("waitForServer");
|
||||
|
||||
@@ -1820,6 +1868,7 @@
|
||||
@@ -1870,6 +1918,7 @@
|
||||
this.field_71456_v.func_181029_i();
|
||||
this.field_71422_O = null;
|
||||
this.field_71455_al = false;
|
||||
@@ -320,7 +320,7 @@
|
||||
this.field_213274_aO.func_216815_b();
|
||||
}
|
||||
|
||||
@@ -1850,6 +1899,7 @@
|
||||
@@ -1900,6 +1949,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_();
|
||||
@@ -328,7 +328,7 @@
|
||||
}
|
||||
|
||||
public boolean func_238216_r_() {
|
||||
@@ -1895,112 +1945,9 @@
|
||||
@@ -1945,112 +1995,9 @@
|
||||
|
||||
private void func_147112_ai() {
|
||||
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
|
||||
@@ -444,7 +444,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2090,6 +2037,7 @@
|
||||
@@ -2140,6 +2087,7 @@
|
||||
return field_71432_P;
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
public CompletableFuture<Void> func_213245_w() {
|
||||
return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> {
|
||||
return p_229993_0_;
|
||||
@@ -2397,7 +2345,7 @@
|
||||
@@ -2451,7 +2399,7 @@
|
||||
supplier = func_228022_c_(supplier);
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@
|
||||
}
|
||||
|
||||
private static Supplier<IResourcePack> func_228021_b_(Supplier<IResourcePack> p_228021_0_) {
|
||||
@@ -2416,6 +2364,14 @@
|
||||
@@ -2470,6 +2418,14 @@
|
||||
this.field_175617_aL.func_229355_a_(p_228020_1_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/IngameGui.java
|
||||
+++ b/net/minecraft/client/gui/IngameGui.java
|
||||
@@ -78,7 +78,7 @@
|
||||
@@ -79,7 +79,7 @@
|
||||
protected static final ResourceLocation field_110329_b = new ResourceLocation("textures/misc/vignette.png");
|
||||
protected static final ResourceLocation field_110330_c = new ResourceLocation("textures/gui/widgets.png");
|
||||
protected static final ResourceLocation field_110328_d = new ResourceLocation("textures/misc/pumpkinblur.png");
|
||||
@@ -9,7 +9,7 @@
|
||||
protected final Random field_73842_c = new Random();
|
||||
protected final Minecraft field_73839_d;
|
||||
protected final ItemRenderer field_73841_b;
|
||||
@@ -414,6 +414,9 @@
|
||||
@@ -415,6 +415,9 @@
|
||||
|
||||
for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
|
||||
Effect effect = effectinstance.func_188419_a();
|
||||
@@ -19,7 +19,7 @@
|
||||
if (effectinstance.func_205348_f()) {
|
||||
int k = this.field_194811_H;
|
||||
int l = 1;
|
||||
@@ -451,6 +454,7 @@
|
||||
@@ -452,6 +455,7 @@
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);
|
||||
func_238470_a_(p_238444_1_, j1 + 3, k1 + 3, this.func_230927_p_(), 18, 18, textureatlassprite);
|
||||
});
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,7 +579,8 @@
|
||||
@@ -576,7 +580,8 @@
|
||||
iformattabletextcomponent.func_240699_a_(TextFormatting.ITALIC);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
int j = (this.field_194811_H - i) / 2;
|
||||
int k = this.field_194812_I - 59;
|
||||
if (!this.field_73839_d.field_71442_b.func_78755_b()) {
|
||||
@@ -592,7 +597,13 @@
|
||||
@@ -593,7 +598,13 @@
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
func_238467_a_(p_238453_1_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.field_73839_d.field_71474_y.func_216839_a(0));
|
||||
@@ -52,7 +52,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
@@ -1055,7 +1066,7 @@
|
||||
@@ -1056,7 +1067,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;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
this.field_193018_j.add(new RecipeTabToggleWidget(recipebookcategories));
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@
|
||||
@@ -434,7 +434,7 @@
|
||||
|
||||
languagemanager.func_135045_a(language);
|
||||
this.field_191888_F.field_71474_y.field_74363_ab = language.getCode();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screen/LanguageScreen.java
|
||||
+++ b/net/minecraft/client/gui/screen/LanguageScreen.java
|
||||
@@ -45,7 +45,7 @@
|
||||
@@ -46,7 +46,7 @@
|
||||
if (languagescreen$list$languageentry != null && !languagescreen$list$languageentry.field_214398_b.getCode().equals(this.field_146454_h.func_135041_c().getCode())) {
|
||||
this.field_146454_h.func_135045_a(languagescreen$list$languageentry.field_214398_b);
|
||||
this.field_228183_b_.field_74363_ab = languagescreen$list$languageentry.field_214398_b.getCode();
|
||||
|
||||
@@ -7,23 +7,35 @@
|
||||
- this.func_243308_b(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_);
|
||||
+ FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_);
|
||||
+ net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_);
|
||||
+ this.renderToolTip(p_230457_1_, Lists.transform(this.func_231151_a_(p_230457_2_), ITextComponent::func_241878_f), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
|
||||
+ this.renderWrappedToolTip(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
|
||||
+ net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip();
|
||||
}
|
||||
|
||||
public List<ITextComponent> func_231151_a_(ItemStack p_231151_1_) {
|
||||
@@ -129,6 +132,10 @@
|
||||
@@ -121,14 +124,20 @@
|
||||
}
|
||||
|
||||
public void func_238652_a_(MatrixStack p_238652_1_, ITextComponent p_238652_2_, int p_238652_3_, int p_238652_4_) {
|
||||
- this.func_238654_b_(p_238652_1_, Arrays.asList(p_238652_2_.func_241878_f()), p_238652_3_, p_238652_4_);
|
||||
+ this.func_243308_b(p_238652_1_, Arrays.asList(p_238652_2_), p_238652_3_, p_238652_4_);
|
||||
}
|
||||
|
||||
public void func_243308_b(MatrixStack p_243308_1_, List<ITextComponent> p_243308_2_, int p_243308_3_, int p_243308_4_) {
|
||||
- this.func_238654_b_(p_243308_1_, Lists.transform(p_243308_2_, ITextComponent::func_241878_f), p_243308_3_, p_243308_4_);
|
||||
+ this.renderWrappedToolTip(p_243308_1_, p_243308_2_, p_243308_3_, p_243308_4_, field_230712_o_);
|
||||
}
|
||||
+ public void renderWrappedToolTip(MatrixStack matrixStack, List<? extends net.minecraft.util.text.ITextProperties> tooltips, int mouseX, int mouseY, FontRenderer font) {
|
||||
+ net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(matrixStack, tooltips, mouseX, mouseY, field_230708_k_, field_230709_l_, -1, font);
|
||||
+ }
|
||||
|
||||
public void func_238654_b_(MatrixStack p_238654_1_, List<? extends IReorderingProcessor> p_238654_2_, int p_238654_3_, int p_238654_4_) {
|
||||
+ this.renderToolTip(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230712_o_);
|
||||
+ }
|
||||
+ public void renderToolTip(MatrixStack p_238654_1_, List<? extends IReorderingProcessor> p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) {
|
||||
+ //net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230708_k_, field_230709_l_, -1, font);
|
||||
if (!p_238654_2_.isEmpty()) {
|
||||
int i = 0;
|
||||
|
||||
@@ -289,9 +296,12 @@
|
||||
@@ -289,9 +298,12 @@
|
||||
}
|
||||
|
||||
public void func_231159_b_(String p_231159_1_, boolean p_231159_2_) {
|
||||
@@ -36,7 +48,7 @@
|
||||
|
||||
this.field_230706_i_.field_71439_g.func_71165_d(p_231159_1_);
|
||||
}
|
||||
@@ -302,10 +312,17 @@
|
||||
@@ -302,10 +314,17 @@
|
||||
this.field_230712_o_ = p_231158_1_.field_71466_p;
|
||||
this.field_230708_k_ = p_231158_2_;
|
||||
this.field_230709_l_ = p_231158_3_;
|
||||
@@ -54,7 +66,7 @@
|
||||
}
|
||||
|
||||
public List<? extends IGuiEventListener> func_231039_at__() {
|
||||
@@ -328,6 +345,7 @@
|
||||
@@ -328,6 +347,7 @@
|
||||
public void func_238651_a_(MatrixStack p_238651_1_, int p_238651_2_) {
|
||||
if (this.field_230706_i_.field_71441_e != null) {
|
||||
this.func_238468_a_(p_238651_1_, 0, 0, this.field_230708_k_, this.field_230709_l_, -1072689136, -804253680);
|
||||
@@ -62,7 +74,7 @@
|
||||
} else {
|
||||
this.func_231165_f_(p_238651_2_);
|
||||
}
|
||||
@@ -346,6 +364,7 @@
|
||||
@@ -346,6 +366,7 @@
|
||||
bufferbuilder.func_225582_a_((double)this.field_230708_k_, 0.0D, 0.0D).func_225583_a_((float)this.field_230708_k_ / 32.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
|
||||
bufferbuilder.func_225582_a_(0.0D, 0.0D, 0.0D).func_225583_a_(0.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
|
||||
tessellator.func_78381_a();
|
||||
@@ -70,7 +82,7 @@
|
||||
}
|
||||
|
||||
public boolean func_231177_au__() {
|
||||
@@ -432,4 +451,8 @@
|
||||
@@ -432,4 +453,8 @@
|
||||
|
||||
public void func_230476_a_(List<Path> p_230476_1_) {
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screen/ServerSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/screen/ServerSelectionList.java
|
||||
@@ -310,6 +310,8 @@
|
||||
@@ -307,6 +307,8 @@
|
||||
this.field_148303_c.func_238854_b_(list1);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@
|
||||
- this.func_243308_b(p_230457_1_, list1, p_230457_3_, p_230457_4_);
|
||||
+ net.minecraft.client.gui.FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_);
|
||||
+ net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_);
|
||||
+ this.renderToolTip(p_230457_1_, Lists.transform(list1, ITextComponent::func_241878_f), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
|
||||
+ this.renderWrappedToolTip(p_230457_1_, list1, p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font));
|
||||
+ net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip();
|
||||
} else {
|
||||
super.func_230457_a_(p_230457_1_, p_230457_2_, p_230457_3_, p_230457_4_);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/widget/list/AbstractList.java
|
||||
+++ b/net/minecraft/client/gui/widget/list/AbstractList.java
|
||||
@@ -471,6 +471,13 @@
|
||||
@@ -492,6 +492,13 @@
|
||||
p_238480_1_.field_230666_a_ = this;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/network/login/ClientLoginNetHandler.java
|
||||
+++ b/net/minecraft/client/network/login/ClientLoginNetHandler.java
|
||||
@@ -99,6 +99,7 @@
|
||||
@@ -115,6 +115,7 @@
|
||||
this.field_209525_d.accept(new TranslationTextComponent("connect.joining"));
|
||||
this.field_175091_e = p_147390_1_.func_179730_a();
|
||||
this.field_147393_d.func_150723_a(ProtocolType.PLAY);
|
||||
@@ -8,7 +8,7 @@
|
||||
this.field_147393_d.func_150719_a(new ClientPlayNetHandler(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e));
|
||||
}
|
||||
|
||||
@@ -127,6 +128,7 @@
|
||||
@@ -143,6 +144,7 @@
|
||||
}
|
||||
|
||||
public void func_209521_a(SCustomPayloadLoginPacket p_209521_1_) {
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
this.field_199725_m = itagcollectionsupplier;
|
||||
if (!this.field_147302_e.func_150731_c()) {
|
||||
itagcollectionsupplier.func_242212_e();
|
||||
@@ -1883,10 +1899,12 @@
|
||||
@@ -1885,10 +1901,12 @@
|
||||
int l5 = packetbuffer.readInt();
|
||||
this.field_147299_f.field_184132_p.field_229018_q_.func_229022_a_(blockpos8, l3, s10, l5);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/network/play/NetworkPlayerInfo.java
|
||||
+++ b/net/minecraft/client/network/play/NetworkPlayerInfo.java
|
||||
@@ -50,6 +50,7 @@
|
||||
}
|
||||
|
||||
protected void func_178839_a(GameType p_178839_1_) {
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onClientChangeGameMode(this, this.field_178866_b, p_178839_1_);
|
||||
this.field_178866_b = p_178839_1_;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,15 @@
|
||||
this.func_228441_a_(RenderType.func_228643_e_(), p_228426_1_, d0, d1, d2);
|
||||
if (this.field_72769_h.func_239132_a_().func_239217_c_()) {
|
||||
RenderHelper.func_237533_a_(p_228426_1_.func_227866_c_().func_227870_a_());
|
||||
@@ -972,7 +979,7 @@
|
||||
IRenderTypeBuffer.Impl irendertypebuffer$impl = this.field_228415_m_.func_228487_b_();
|
||||
|
||||
for(Entity entity : this.field_72769_h.func_217416_b()) {
|
||||
- if ((this.field_175010_j.func_229086_a_(entity, clippinghelper, d0, d1, d2) || entity.func_184215_y(this.field_72777_q.field_71439_g)) && (entity != p_228426_6_.func_216773_g() || p_228426_6_.func_216770_i() || p_228426_6_.func_216773_g() instanceof LivingEntity && ((LivingEntity)p_228426_6_.func_216773_g()).func_70608_bn()) && (!(entity instanceof ClientPlayerEntity) || p_228426_6_.func_216773_g() == entity)) {
|
||||
+ if ((this.field_175010_j.func_229086_a_(entity, clippinghelper, d0, d1, d2) || entity.func_184215_y(this.field_72777_q.field_71439_g)) && (entity != p_228426_6_.func_216773_g() || p_228426_6_.func_216770_i() || p_228426_6_.func_216773_g() instanceof LivingEntity && ((LivingEntity)p_228426_6_.func_216773_g()).func_70608_bn()) && (!(entity instanceof ClientPlayerEntity) || p_228426_6_.func_216773_g() == entity || (entity == field_72777_q.field_71439_g && !field_72777_q.field_71439_g.func_175149_v()))) { //FORGE: render local player entity when it is not the renderViewEntity
|
||||
++this.field_72749_I;
|
||||
if (entity.field_70173_aa == 0) {
|
||||
entity.field_70142_S = entity.func_226277_ct_();
|
||||
@@ -1010,6 +1017,7 @@
|
||||
List<TileEntity> list = worldrenderer$localrenderinformationcontainer.field_178036_a.func_178571_g().func_178485_b();
|
||||
if (!list.isEmpty()) {
|
||||
|
||||
@@ -13,3 +13,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +79,7 @@
|
||||
|
||||
protected void func_225629_a_(T p_225629_1_, ITextComponent p_225629_2_, MatrixStack p_225629_3_, IRenderTypeBuffer p_225629_4_, int p_225629_5_) {
|
||||
double d0 = this.field_76990_c.func_229099_b_(p_225629_1_);
|
||||
- if (!(d0 > 4096.0D)) {
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.isNameplateInRenderDistance(p_225629_1_, d0)) {
|
||||
boolean flag = !p_225629_1_.func_226273_bm_();
|
||||
float f = p_225629_1_.func_213302_cg() + 0.5F;
|
||||
int i = "deadmau5".equals(p_225629_2_.getString()) ? -10 : 0;
|
||||
@@ -13,5 +13,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
+ @Override public boolean func_151470_d() { return this.field_74513_e; }
|
||||
+ @Override public boolean func_151470_d() { return this.field_74513_e && (isConflictContextAndModifierActive() || field_228053_a_.getAsBoolean()); }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/command/arguments/ArgumentTypes.java
|
||||
+++ b/net/minecraft/command/arguments/ArgumentTypes.java
|
||||
@@ -220,4 +220,8 @@
|
||||
this.field_197481_c = p_i48088_3_;
|
||||
}
|
||||
}
|
||||
+ @javax.annotation.Nullable public static ResourceLocation getId(ArgumentType<?> type) {
|
||||
+ Entry<?> entry = func_201040_a(type);
|
||||
+ return entry == null ? null : entry.field_197481_c;
|
||||
+ }
|
||||
}
|
||||
@@ -1,15 +1,31 @@
|
||||
--- a/net/minecraft/enchantment/Enchantment.java
|
||||
+++ b/net/minecraft/enchantment/Enchantment.java
|
||||
@@ -18,7 +18,7 @@
|
||||
@@ -18,7 +18,8 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public abstract class Enchantment {
|
||||
+public abstract class Enchantment extends net.minecraftforge.registries.ForgeRegistryEntry<Enchantment> {
|
||||
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Enchantment> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.TagCollectionManager.func_242178_a().getCustomTypeCollection(net.minecraftforge.registries.ForgeRegistries.ENCHANTMENTS));
|
||||
private final EquipmentSlotType[] field_185263_a;
|
||||
private final Enchantment.Rarity field_77333_a;
|
||||
public final EnchantmentType field_77351_y;
|
||||
@@ -114,7 +114,7 @@
|
||||
@@ -37,6 +38,14 @@
|
||||
this.field_185263_a = p_i46731_3_;
|
||||
}
|
||||
|
||||
+ public java.util.Set<net.minecraft.util.ResourceLocation> getTags() {
|
||||
+ return reverseTags.getTagNames();
|
||||
+ }
|
||||
+
|
||||
+ public boolean isIn(net.minecraft.tags.ITag<Enchantment> tag) {
|
||||
+ return tag.func_230235_a_(this);
|
||||
+ }
|
||||
+
|
||||
public Map<EquipmentSlotType, ItemStack> func_222181_a(LivingEntity p_222181_1_) {
|
||||
Map<EquipmentSlotType, ItemStack> map = Maps.newEnumMap(EquipmentSlotType.class);
|
||||
|
||||
@@ -114,7 +123,7 @@
|
||||
}
|
||||
|
||||
public boolean func_92089_a(ItemStack p_92089_1_) {
|
||||
@@ -18,7 +34,7 @@
|
||||
}
|
||||
|
||||
public void func_151368_a(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) {
|
||||
@@ -139,6 +139,24 @@
|
||||
@@ -139,6 +148,24 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,9 +231,8 @@
|
||||
this.func_213319_R();
|
||||
this.field_70170_p.func_217381_Z().func_76320_a("reposition");
|
||||
- PortalInfo portalinfo = this.func_241829_a(p_241206_1_);
|
||||
- if (portalinfo == null) {
|
||||
+ PortalInfo portalinfo = teleporter.isVanilla() ? this.func_241829_a(p_241206_1_) : null;
|
||||
+ if (portalinfo == null && teleporter.isVanilla()) {
|
||||
+ PortalInfo portalinfo = teleporter.getPortalInfo(this, p_241206_1_, this::func_241829_a);
|
||||
if (portalinfo == null) {
|
||||
return null;
|
||||
} else {
|
||||
+ Entity transportedEntity = teleporter.placeEntity(this, (ServerWorld) this.field_70170_p, p_241206_1_, this.field_70177_z, spawnPortal -> { //Forge: Start vanilla logic
|
||||
|
||||
@@ -9,13 +9,28 @@
|
||||
MONSTER("monster", 70, false, false, 128),
|
||||
CREATURE("creature", 10, true, true, 128),
|
||||
AMBIENT("ambient", 15, true, false, 128),
|
||||
@@ -57,6 +57,10 @@
|
||||
@@ -14,7 +14,7 @@
|
||||
WATER_AMBIENT("water_ambient", 20, true, false, 64),
|
||||
MISC("misc", -1, true, true, 128);
|
||||
|
||||
- public static final Codec<EntityClassification> field_233667_g_ = IStringSerializable.func_233023_a_(EntityClassification::values, EntityClassification::func_233670_a_);
|
||||
+ public static final Codec<EntityClassification> field_233667_g_ = net.minecraftforge.common.IExtensibleEnum.createCodecForExtensibleEnum(EntityClassification::values, EntityClassification::func_233670_a_);
|
||||
private static final Map<String, EntityClassification> field_220364_f = Arrays.stream(values()).collect(Collectors.toMap(EntityClassification::func_220363_a, (p_220362_0_) -> {
|
||||
return p_220362_0_;
|
||||
}));
|
||||
@@ -57,6 +57,16 @@
|
||||
return this.field_82707_i;
|
||||
}
|
||||
|
||||
+ public static EntityClassification create(String name, String id, int maxNumberOfCreatureIn, boolean isPeacefulCreatureIn, boolean isAnimalIn, int despawnDistance) {
|
||||
+ throw new IllegalStateException("Enum not extended");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @Deprecated
|
||||
+ public void init() {
|
||||
+ field_220364_f.put(this.func_220363_a(), this);
|
||||
+ }
|
||||
+
|
||||
public int func_233671_f_() {
|
||||
return this.field_233669_n_;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--- a/net/minecraft/entity/monster/HoglinEntity.java
|
||||
+++ b/net/minecraft/entity/monster/HoglinEntity.java
|
||||
@@ -279,8 +279,8 @@
|
||||
return hoglinentity;
|
||||
}
|
||||
|
||||
- public boolean func_204701_dC() {
|
||||
- return !HoglinTasks.func_234386_c_(this) && super.func_204701_dC();
|
||||
+ public boolean func_213743_em() {
|
||||
+ return !HoglinTasks.func_234386_c_(this) && super.func_213743_em();
|
||||
}
|
||||
|
||||
public SoundCategory func_184176_by() {
|
||||
@@ -1,23 +1,5 @@
|
||||
--- a/net/minecraft/entity/passive/AnimalEntity.java
|
||||
+++ b/net/minecraft/entity/passive/AnimalEntity.java
|
||||
@@ -121,7 +121,7 @@
|
||||
ItemStack itemstack = p_230254_1_.func_184586_b(p_230254_2_);
|
||||
if (this.func_70877_b(itemstack)) {
|
||||
int i = this.func_70874_b();
|
||||
- if (!this.field_70170_p.field_72995_K && i == 0 && this.func_204701_dC()) {
|
||||
+ if (!this.field_70170_p.field_72995_K && i == 0 && this.func_213743_em()) {
|
||||
this.func_175505_a(p_230254_1_, itemstack);
|
||||
this.func_146082_f(p_230254_1_);
|
||||
return ActionResultType.SUCCESS;
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
}
|
||||
|
||||
- public boolean func_204701_dC() {
|
||||
+ public boolean func_213743_em() {
|
||||
return this.field_70881_d <= 0;
|
||||
}
|
||||
|
||||
@@ -199,6 +199,17 @@
|
||||
|
||||
public void func_234177_a_(ServerWorld p_234177_1_, AnimalEntity p_234177_2_) {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/entity/passive/PandaEntity.java
|
||||
+++ b/net/minecraft/entity/passive/PandaEntity.java
|
||||
@@ -586,7 +586,7 @@
|
||||
if (this.func_70631_g_()) {
|
||||
this.func_175505_a(p_230254_1_, itemstack);
|
||||
this.func_175501_a((int)((float)(-this.func_70874_b() / 20) * 0.1F), true);
|
||||
- } else if (!this.field_70170_p.field_72995_K && this.func_70874_b() == 0 && this.func_204701_dC()) {
|
||||
+ } else if (!this.field_70170_p.field_72995_K && this.func_70874_b() == 0 && this.func_213743_em()) {
|
||||
this.func_175505_a(p_230254_1_, itemstack);
|
||||
this.func_146082_f(p_230254_1_);
|
||||
} else {
|
||||
@@ -1,13 +0,0 @@
|
||||
--- a/net/minecraft/entity/passive/TurtleEntity.java
|
||||
+++ b/net/minecraft/entity/passive/TurtleEntity.java
|
||||
@@ -235,8 +235,8 @@
|
||||
this.func_184185_a(soundevent, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
- public boolean func_204701_dC() {
|
||||
- return super.func_204701_dC() && !this.func_203020_dx();
|
||||
+ public boolean func_213743_em() {
|
||||
+ return super.func_213743_em() && !this.func_203020_dx();
|
||||
}
|
||||
|
||||
protected float func_203009_ad() {
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/entity/passive/horse/LlamaEntity.java
|
||||
+++ b/net/minecraft/entity/passive/horse/LlamaEntity.java
|
||||
@@ -181,7 +181,7 @@
|
||||
i = 90;
|
||||
j = 6;
|
||||
f = 10.0F;
|
||||
- if (this.func_110248_bS() && this.func_70874_b() == 0 && this.func_204701_dC()) {
|
||||
+ if (this.func_110248_bS() && this.func_70874_b() == 0 && this.func_213743_em()) {
|
||||
flag = true;
|
||||
this.func_146082_f(p_190678_1_);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/entity/player/ServerPlayerEntity.java
|
||||
+++ b/net/minecraft/entity/player/ServerPlayerEntity.java
|
||||
@@ -471,6 +471,7 @@
|
||||
@@ -475,6 +475,7 @@
|
||||
}
|
||||
|
||||
public void func_70645_a(DamageSource p_70645_1_) {
|
||||
@@ -8,7 +8,7 @@
|
||||
boolean flag = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223609_l);
|
||||
if (flag) {
|
||||
ITextComponent itextcomponent = this.func_110142_aN().func_151521_b();
|
||||
@@ -614,13 +615,14 @@
|
||||
@@ -618,13 +619,14 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -26,18 +26,17 @@
|
||||
if (!this.field_71136_j) {
|
||||
this.field_71136_j = true;
|
||||
this.field_71135_a.func_147359_a(new SChangeGameStatePacket(SChangeGameStatePacket.field_241768_e_, this.field_192040_cp ? 0.0F : 1.0F));
|
||||
@@ -634,14 +636,15 @@
|
||||
@@ -638,14 +640,15 @@
|
||||
this.field_71135_a.func_147359_a(new SServerDifficultyPacket(iworldinfo.func_176130_y(), iworldinfo.func_176123_z()));
|
||||
PlayerList playerlist = this.field_71133_b.func_184103_al();
|
||||
playerlist.func_187243_f(this);
|
||||
- serverworld.func_217434_e(this);
|
||||
- this.field_70128_L = false;
|
||||
- PortalInfo portalinfo = this.func_241829_a(p_241206_1_);
|
||||
- if (portalinfo != null) {
|
||||
+ serverworld.removeEntity(this, true); //Forge: the player entity is moved to the new world, NOT cloned. So keep the data alive with no matching invalidate call.
|
||||
+ this.revive();
|
||||
+ PortalInfo portalinfo = teleporter.isVanilla() ? this.func_241829_a(p_241206_1_) : null;
|
||||
+ if (portalinfo != null || !teleporter.isVanilla()) {
|
||||
+ PortalInfo portalinfo = teleporter.getPortalInfo(this, p_241206_1_, this::func_241829_a);
|
||||
if (portalinfo != null) {
|
||||
+ Entity e = teleporter.placeEntity(this, serverworld, p_241206_1_, this.field_70177_z, spawnPortal -> {//Forge: Start vanilla logic
|
||||
serverworld.func_217381_Z().func_76320_a("moving");
|
||||
if (registrykey == World.field_234918_g_ && p_241206_1_.func_234923_W_() == World.field_234919_h_) {
|
||||
@@ -47,7 +46,7 @@
|
||||
this.func_242110_a(p_241206_1_, new BlockPos(portalinfo.field_222505_a));
|
||||
}
|
||||
|
||||
@@ -653,6 +656,9 @@
|
||||
@@ -657,6 +660,9 @@
|
||||
this.func_225653_b_(portalinfo.field_222505_a.field_72450_a, portalinfo.field_222505_a.field_72448_b, portalinfo.field_222505_a.field_72449_c);
|
||||
serverworld.func_217381_Z().func_76319_b();
|
||||
this.func_213846_b(serverworld);
|
||||
@@ -57,7 +56,7 @@
|
||||
this.field_71134_c.func_73080_a(p_241206_1_);
|
||||
this.field_71135_a.func_147359_a(new SPlayerAbilitiesPacket(this.field_71075_bZ));
|
||||
playerlist.func_72354_b(this, p_241206_1_);
|
||||
@@ -666,6 +672,7 @@
|
||||
@@ -670,6 +676,7 @@
|
||||
this.field_71144_ck = -1;
|
||||
this.field_71149_ch = -1.0F;
|
||||
this.field_71146_ci = -1;
|
||||
@@ -65,7 +64,7 @@
|
||||
}
|
||||
|
||||
return this;
|
||||
@@ -739,6 +746,9 @@
|
||||
@@ -743,6 +750,9 @@
|
||||
}
|
||||
|
||||
public Either<PlayerEntity.SleepResult, Unit> func_213819_a(BlockPos p_213819_1_) {
|
||||
@@ -75,7 +74,7 @@
|
||||
Direction direction = this.field_70170_p.func_180495_p(p_213819_1_).func_177229_b(HorizontalBlock.field_185512_D);
|
||||
if (!this.func_70608_bn() && this.func_70089_S()) {
|
||||
if (!this.field_70170_p.func_230315_m_().func_236043_f_()) {
|
||||
@@ -749,7 +759,7 @@
|
||||
@@ -753,7 +763,7 @@
|
||||
return Either.left(PlayerEntity.SleepResult.OBSTRUCTED);
|
||||
} else {
|
||||
this.func_242111_a(this.field_70170_p.func_234923_W_(), p_213819_1_, this.field_70177_z, false, true);
|
||||
@@ -84,7 +83,7 @@
|
||||
return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW);
|
||||
} else {
|
||||
if (!this.func_184812_l_()) {
|
||||
@@ -783,6 +793,7 @@
|
||||
@@ -787,6 +797,7 @@
|
||||
}
|
||||
|
||||
private boolean func_241147_a_(BlockPos p_241147_1_, Direction p_241147_2_) {
|
||||
@@ -92,7 +91,7 @@
|
||||
return this.func_241158_g_(p_241147_1_) || this.func_241158_g_(p_241147_1_.func_177972_a(p_241147_2_.func_176734_d()));
|
||||
}
|
||||
|
||||
@@ -882,6 +893,7 @@
|
||||
@@ -886,6 +897,7 @@
|
||||
this.field_71135_a.func_147359_a(new SOpenWindowPacket(container.field_75152_c, container.func_216957_a(), p_213829_1_.func_145748_c_()));
|
||||
container.func_75132_a(this);
|
||||
this.field_71070_bA = container;
|
||||
@@ -100,7 +99,7 @@
|
||||
return OptionalInt.of(this.field_71139_cq);
|
||||
}
|
||||
}
|
||||
@@ -900,6 +912,7 @@
|
||||
@@ -904,6 +916,7 @@
|
||||
this.field_71135_a.func_147359_a(new SOpenHorseWindowPacket(this.field_71139_cq, p_184826_2_.func_70302_i_(), p_184826_1_.func_145782_y()));
|
||||
this.field_71070_bA = new HorseInventoryContainer(this.field_71139_cq, this.field_71071_by, p_184826_2_, p_184826_1_);
|
||||
this.field_71070_bA.func_75132_a(this);
|
||||
@@ -108,7 +107,7 @@
|
||||
}
|
||||
|
||||
public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) {
|
||||
@@ -957,6 +970,7 @@
|
||||
@@ -961,6 +974,7 @@
|
||||
|
||||
public void func_71128_l() {
|
||||
this.field_71070_bA.func_75134_a(this);
|
||||
@@ -116,7 +115,7 @@
|
||||
this.field_71070_bA = this.field_71069_bz;
|
||||
}
|
||||
|
||||
@@ -1081,6 +1095,13 @@
|
||||
@@ -1085,6 +1099,13 @@
|
||||
this.field_193110_cw = p_193104_1_.field_193110_cw;
|
||||
this.func_192029_h(p_193104_1_.func_192023_dk());
|
||||
this.func_192031_i(p_193104_1_.func_192025_dl());
|
||||
@@ -130,7 +129,15 @@
|
||||
}
|
||||
|
||||
protected void func_70670_a(EffectInstance p_70670_1_) {
|
||||
@@ -1187,6 +1208,7 @@
|
||||
@@ -1143,6 +1164,7 @@
|
||||
}
|
||||
|
||||
public void func_71033_a(GameType p_71033_1_) {
|
||||
+ if (!net.minecraftforge.common.ForgeHooks.onChangeGameMode(this, this.field_71134_c.func_73081_b(), p_71033_1_)) return;
|
||||
this.field_71134_c.func_73076_a(p_71033_1_);
|
||||
this.field_71135_a.func_147359_a(new SChangeGameStatePacket(SChangeGameStatePacket.field_241767_d_, (float)p_71033_1_.func_77148_a()));
|
||||
if (p_71033_1_ == GameType.SPECTATOR) {
|
||||
@@ -1191,6 +1213,7 @@
|
||||
this.field_71140_co = p_147100_1_.func_149520_f();
|
||||
this.func_184212_Q().func_187227_b(field_184827_bp, (byte)p_147100_1_.func_149521_d());
|
||||
this.func_184212_Q().func_187227_b(field_184828_bq, (byte)(p_147100_1_.func_186991_f() == HandSide.LEFT ? 0 : 1));
|
||||
@@ -138,7 +145,7 @@
|
||||
}
|
||||
|
||||
public ChatVisibility func_147096_v() {
|
||||
@@ -1297,14 +1319,14 @@
|
||||
@@ -1301,14 +1324,14 @@
|
||||
this.func_184210_p();
|
||||
if (p_200619_1_ == this.field_70170_p) {
|
||||
this.field_71135_a.func_147364_a(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
|
||||
@@ -156,7 +163,7 @@
|
||||
this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
|
||||
this.func_70029_a(p_200619_1_);
|
||||
p_200619_1_.func_217446_a(this);
|
||||
@@ -1313,6 +1335,7 @@
|
||||
@@ -1317,6 +1340,7 @@
|
||||
this.field_71134_c.func_73080_a(p_200619_1_);
|
||||
this.field_71133_b.func_184103_al().func_72354_b(this, p_200619_1_);
|
||||
this.field_71133_b.func_184103_al().func_72385_f(this);
|
||||
@@ -164,7 +171,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1335,6 +1358,7 @@
|
||||
@@ -1339,6 +1363,7 @@
|
||||
}
|
||||
|
||||
public void func_242111_a(RegistryKey<World> p_242111_1_, @Nullable BlockPos p_242111_2_, float p_242111_3_, boolean p_242111_4_, boolean p_242111_5_) {
|
||||
@@ -172,7 +179,7 @@
|
||||
if (p_242111_2_ != null) {
|
||||
boolean flag = p_242111_2_.equals(this.field_241138_cr_) && p_242111_1_.equals(this.field_241137_cq_);
|
||||
if (p_242111_5_ && !flag) {
|
||||
@@ -1387,6 +1411,8 @@
|
||||
@@ -1391,6 +1416,8 @@
|
||||
if (itementity == null) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -181,11 +188,10 @@
|
||||
this.field_70170_p.func_217376_c(itementity);
|
||||
ItemStack itemstack = itementity.func_92059_d();
|
||||
if (p_146097_3_) {
|
||||
@@ -1400,4 +1426,13 @@
|
||||
return itementity;
|
||||
@@ -1405,6 +1432,15 @@
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
+ private String language = "en_us";
|
||||
+ /**
|
||||
+ * Returns the language last reported by the player as their local language.
|
||||
@@ -194,4 +200,7 @@
|
||||
+ public String getLanguage() {
|
||||
+ return this.language;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
@Nullable
|
||||
public IChatFilter func_244529_Q() {
|
||||
return this.field_244528_co;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/entity/projectile/FireworkRocketEntity.java
|
||||
+++ b/net/minecraft/entity/projectile/FireworkRocketEntity.java
|
||||
@@ -155,6 +155,13 @@
|
||||
@@ -156,6 +156,13 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
+
|
||||
if (!itemstack2.func_190926_b()) {
|
||||
- boolean flag = itemstack2.func_77973_b() == Items.field_151134_bR && !EnchantedBookItem.func_92110_g(itemstack2).isEmpty();
|
||||
+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_234642_c_, field_82857_m, j)) return;
|
||||
+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_234642_c_, field_82857_m, j, this.field_234645_f_)) return;
|
||||
+ flag = itemstack2.func_77973_b() == Items.field_151134_bR && !EnchantedBookItem.func_92110_g(itemstack2).isEmpty();
|
||||
if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) {
|
||||
int l2 = Math.min(itemstack1.func_77952_i(), itemstack1.func_77958_k() / 4);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/network/NetworkManager.java
|
||||
+++ b/net/minecraft/network/NetworkManager.java
|
||||
@@ -75,6 +75,7 @@
|
||||
@@ -74,6 +74,7 @@
|
||||
private float field_211397_t;
|
||||
private int field_211398_u;
|
||||
private boolean field_211399_v;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public NetworkManager(PacketDirection p_i46004_1_) {
|
||||
this.field_179294_g = p_i46004_1_;
|
||||
@@ -84,6 +85,7 @@
|
||||
@@ -83,6 +84,7 @@
|
||||
super.channelActive(p_channelActive_1_);
|
||||
this.field_150746_k = p_channelActive_1_.channel();
|
||||
this.field_150743_l = this.field_150746_k.remoteAddress();
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
try {
|
||||
this.func_150723_a(ProtocolType.HANDSHAKING);
|
||||
@@ -172,7 +174,7 @@
|
||||
@@ -171,7 +173,7 @@
|
||||
++this.field_211395_r;
|
||||
if (protocoltype1 != protocoltype) {
|
||||
field_150735_g.debug("Disabled auto read");
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
|
||||
if (this.field_150746_k.eventLoop().inEventLoop()) {
|
||||
@@ -260,7 +262,9 @@
|
||||
@@ -259,7 +261,9 @@
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) {
|
||||
@@ -35,7 +35,7 @@
|
||||
Class<? extends SocketChannel> oclass;
|
||||
LazyValue<? extends EventLoopGroup> lazyvalue;
|
||||
if (Epoll.isAvailable() && p_181124_2_) {
|
||||
@@ -287,6 +291,7 @@
|
||||
@@ -286,6 +290,7 @@
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static NetworkManager func_150722_a(SocketAddress p_150722_0_) {
|
||||
final NetworkManager networkmanager = new NetworkManager(PacketDirection.CLIENTBOUND);
|
||||
@@ -43,7 +43,7 @@
|
||||
(new Bootstrap()).group(field_179296_e.func_179281_c()).handler(new ChannelInitializer<Channel>() {
|
||||
protected void initChannel(Channel p_initChannel_1_) throws Exception {
|
||||
p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager);
|
||||
@@ -377,6 +382,14 @@
|
||||
@@ -376,6 +381,14 @@
|
||||
return this.field_211397_t;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/network/login/ServerLoginNetHandler.java
|
||||
+++ b/net/minecraft/network/login/ServerLoginNetHandler.java
|
||||
@@ -53,7 +53,13 @@
|
||||
@@ -55,7 +55,13 @@
|
||||
}
|
||||
|
||||
public void func_73660_a() {
|
||||
@@ -15,48 +15,48 @@
|
||||
this.func_147326_c();
|
||||
} else if (this.field_147328_g == ServerLoginNetHandler.State.DELAY_ACCEPT) {
|
||||
ServerPlayerEntity serverplayerentity = this.field_147327_f.func_184103_al().func_177451_a(this.field_147337_i.getId());
|
||||
@@ -128,7 +134,7 @@
|
||||
@@ -130,7 +136,7 @@
|
||||
this.field_147328_g = ServerLoginNetHandler.State.KEY;
|
||||
this.field_147333_a.func_179290_a(new SEncryptionRequestPacket("", this.field_147327_f.func_71250_E().getPublic(), this.field_147330_e));
|
||||
this.field_147333_a.func_179290_a(new SEncryptionRequestPacket("", this.field_147327_f.func_71250_E().getPublic().getEncoded(), this.field_147330_e));
|
||||
} else {
|
||||
- this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
+ this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -142,7 +148,7 @@
|
||||
this.field_147335_k = p_147315_1_.func_149300_a(privatekey);
|
||||
this.field_147328_g = ServerLoginNetHandler.State.AUTHENTICATING;
|
||||
this.field_147333_a.func_150727_a(this.field_147335_k);
|
||||
- Thread thread = new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) {
|
||||
+ Thread thread = new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, "User Authenticator #" + field_147331_b.incrementAndGet()) {
|
||||
public void run() {
|
||||
GameProfile gameprofile = ServerLoginNetHandler.this.field_147337_i;
|
||||
@@ -155,7 +161,7 @@
|
||||
throw new IllegalStateException("Protocol error", cryptexception);
|
||||
}
|
||||
|
||||
@@ -151,11 +157,11 @@
|
||||
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.func_191235_a());
|
||||
if (ServerLoginNetHandler.this.field_147337_i != null) {
|
||||
ServerLoginNetHandler.field_147332_c.info("UUID of player {} is {}", ServerLoginNetHandler.this.field_147337_i.getName(), ServerLoginNetHandler.this.field_147337_i.getId());
|
||||
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
- Thread thread = new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) {
|
||||
+ Thread thread = new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, "User Authenticator #" + field_147331_b.incrementAndGet()) {
|
||||
public void run() {
|
||||
GameProfile gameprofile = ServerLoginNetHandler.this.field_147337_i;
|
||||
|
||||
@@ -163,11 +169,11 @@
|
||||
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.func_191235_a());
|
||||
if (ServerLoginNetHandler.this.field_147337_i != null) {
|
||||
ServerLoginNetHandler.field_147332_c.info("UUID of player {} is {}", ServerLoginNetHandler.this.field_147337_i.getName(), ServerLoginNetHandler.this.field_147337_i.getId());
|
||||
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
+ ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
|
||||
} else if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
|
||||
ServerLoginNetHandler.field_147332_c.warn("Failed to verify username but will let them in anyway!");
|
||||
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
|
||||
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
} else if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
|
||||
ServerLoginNetHandler.field_147332_c.warn("Failed to verify username but will let them in anyway!");
|
||||
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
|
||||
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
+ ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
|
||||
} else {
|
||||
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.unverified_username"));
|
||||
ServerLoginNetHandler.field_147332_c.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName());
|
||||
@@ -164,7 +170,7 @@
|
||||
if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
|
||||
ServerLoginNetHandler.field_147332_c.warn("Authentication servers are down but will let them in anyway!");
|
||||
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
|
||||
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
} else {
|
||||
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.unverified_username"));
|
||||
ServerLoginNetHandler.field_147332_c.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName());
|
||||
@@ -176,7 +182,7 @@
|
||||
if (ServerLoginNetHandler.this.field_147327_f.func_71264_H()) {
|
||||
ServerLoginNetHandler.field_147332_c.warn("Authentication servers are down but will let them in anyway!");
|
||||
ServerLoginNetHandler.this.field_147337_i = ServerLoginNetHandler.this.func_152506_a(gameprofile);
|
||||
- ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.READY_TO_ACCEPT;
|
||||
+ ServerLoginNetHandler.this.field_147328_g = ServerLoginNetHandler.State.NEGOTIATING;
|
||||
} else {
|
||||
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.authservers_down"));
|
||||
ServerLoginNetHandler.field_147332_c.error("Couldn't verify username because servers are unavailable");
|
||||
@@ -185,6 +191,7 @@
|
||||
} else {
|
||||
ServerLoginNetHandler.this.func_194026_b(new TranslationTextComponent("multiplayer.disconnect.authservers_down"));
|
||||
ServerLoginNetHandler.field_147332_c.error("Couldn't verify username because servers are unavailable");
|
||||
@@ -196,6 +202,7 @@
|
||||
}
|
||||
|
||||
public void func_209526_a(CCustomPayloadLoginPacket p_209526_1_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/network/play/ServerPlayNetHandler.java
|
||||
+++ b/net/minecraft/network/play/ServerPlayNetHandler.java
|
||||
@@ -348,9 +348,11 @@
|
||||
@@ -391,9 +391,11 @@
|
||||
}
|
||||
|
||||
entity.func_70080_a(d3, d4, d5, f, f1);
|
||||
@@ -12,7 +12,7 @@
|
||||
this.field_147371_a.func_179290_a(new SMoveVehiclePacket(entity));
|
||||
return;
|
||||
}
|
||||
@@ -367,7 +369,7 @@
|
||||
@@ -410,7 +412,7 @@
|
||||
}
|
||||
|
||||
private boolean func_241162_a_(Entity p_241162_1_) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
public void func_184339_a(CConfirmTeleportPacket p_184339_1_) {
|
||||
@@ -881,7 +883,9 @@
|
||||
@@ -950,7 +952,9 @@
|
||||
Direction direction = blockraytraceresult.func_216354_b();
|
||||
this.field_147369_b.func_143004_u();
|
||||
if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) {
|
||||
@@ -32,18 +32,18 @@
|
||||
ActionResultType actionresulttype = this.field_147369_b.field_71134_c.func_219441_a(this.field_147369_b, serverworld, itemstack, hand, blockraytraceresult);
|
||||
if (direction == Direction.UP && !actionresulttype.func_226246_a_() && blockpos.func_177956_o() >= this.field_147367_d.func_71207_Z() - 1 && func_241166_a_(this.field_147369_b, itemstack)) {
|
||||
ITextComponent itextcomponent = (new TranslationTextComponent("build.tooHigh", this.field_147367_d.func_71207_Z())).func_240699_a_(TextFormatting.RED);
|
||||
@@ -1014,7 +1018,9 @@
|
||||
if (s.startsWith("/")) {
|
||||
this.func_147361_d(s);
|
||||
@@ -1097,7 +1101,9 @@
|
||||
if (p_244548_1_.startsWith("/")) {
|
||||
this.func_147361_d(p_244548_1_);
|
||||
} else {
|
||||
- ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), s);
|
||||
+ ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s));
|
||||
+ itextcomponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, itextcomponent);
|
||||
- ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), p_244548_1_);
|
||||
+ ITextComponent itextcomponent = new TranslationTextComponent("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(p_244548_1_));
|
||||
+ itextcomponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, p_244548_1_, itextcomponent);
|
||||
+ if (itextcomponent == null) return;
|
||||
this.field_147367_d.func_184103_al().func_232641_a_(itextcomponent, ChatType.CHAT, this.field_147369_b.func_110124_au());
|
||||
}
|
||||
|
||||
@@ -1104,6 +1110,7 @@
|
||||
@@ -1187,6 +1193,7 @@
|
||||
if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT) {
|
||||
optional = Optional.of(this.field_147369_b.func_190775_a(entity, hand));
|
||||
} else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT_AT) {
|
||||
@@ -51,7 +51,7 @@
|
||||
optional = Optional.of(entity.func_184199_a(this.field_147369_b, p_147340_1_.func_179712_b(), hand));
|
||||
} else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.ATTACK) {
|
||||
if (entity instanceof ItemEntity || entity instanceof ExperienceOrbEntity || entity instanceof AbstractArrowEntity || entity == this.field_147369_b) {
|
||||
@@ -1315,6 +1322,8 @@
|
||||
@@ -1402,6 +1409,8 @@
|
||||
}
|
||||
|
||||
public void func_147349_a(CCustomPayloadPacket p_147349_1_) {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/net/minecraft/network/play/server/SCommandListPacket.java
|
||||
+++ b/net/minecraft/network/play/server/SCommandListPacket.java
|
||||
@@ -119,6 +119,9 @@
|
||||
String s = p_197695_0_.func_150789_c(32767);
|
||||
ArgumentType<?> argumenttype = ArgumentTypes.func_197486_a(p_197695_0_);
|
||||
if (argumenttype == null) {
|
||||
+ if ((i & 16) != 0) { // FORGE: Flush unused suggestion data
|
||||
+ p_197695_0_.func_192575_l();
|
||||
+ }
|
||||
return null;
|
||||
} else {
|
||||
RequiredArgumentBuilder<ISuggestionProvider, ?> requiredargumentbuilder = RequiredArgumentBuilder.argument(s, argumenttype);
|
||||
@@ -0,0 +1,22 @@
|
||||
--- a/net/minecraft/network/rcon/ClientThread.java
|
||||
+++ b/net/minecraft/network/rcon/ClientThread.java
|
||||
@@ -116,13 +116,14 @@
|
||||
}
|
||||
|
||||
private void func_72655_a(int p_72655_1_, String p_72655_2_) throws IOException {
|
||||
- int i = p_72655_2_.length();
|
||||
-
|
||||
+ byte[] whole = p_72655_2_.getBytes(StandardCharsets.UTF_8);
|
||||
+ int i = whole.length;
|
||||
+ int start = 0;
|
||||
do {
|
||||
int j = 4096 <= i ? 4096 : i;
|
||||
- this.func_72654_a(p_72655_1_, 0, p_72655_2_.substring(0, j));
|
||||
- p_72655_2_ = p_72655_2_.substring(j);
|
||||
- i = p_72655_2_.length();
|
||||
+ this.func_72654_a(p_72655_1_, 0, new String(java.util.Arrays.copyOfRange(whole, start, j+start), StandardCharsets.UTF_8));
|
||||
+ i -= j;
|
||||
+ start += j;
|
||||
} while(0 != i);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/network/rcon/RConConsoleSource.java
|
||||
+++ b/net/minecraft/network/rcon/RConConsoleSource.java
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
public void func_145747_a(ITextComponent p_145747_1_, UUID p_145747_2_) {
|
||||
- this.field_70009_b.append(p_145747_1_.getString());
|
||||
+ this.field_70009_b.append(p_145747_1_.getString()).append("\n"); // FIX MC-7569 - RCON has no newlines in multiline output
|
||||
}
|
||||
|
||||
public boolean func_195039_a() {
|
||||
@@ -1,11 +1,27 @@
|
||||
--- a/net/minecraft/potion/Potion.java
|
||||
+++ b/net/minecraft/potion/Potion.java
|
||||
@@ -6,7 +6,7 @@
|
||||
@@ -6,7 +6,8 @@
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class Potion {
|
||||
+public class Potion extends net.minecraftforge.registries.ForgeRegistryEntry<Potion> {
|
||||
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Potion> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.TagCollectionManager.func_242178_a().getCustomTypeCollection(net.minecraftforge.registries.ForgeRegistries.POTION_TYPES));
|
||||
private final String field_185179_d;
|
||||
private final ImmutableList<EffectInstance> field_185180_e;
|
||||
|
||||
@@ -23,6 +24,14 @@
|
||||
this.field_185180_e = ImmutableList.copyOf(p_i46740_2_);
|
||||
}
|
||||
|
||||
+ public java.util.Set<net.minecraft.util.ResourceLocation> getTags() {
|
||||
+ return reverseTags.getTagNames();
|
||||
+ }
|
||||
+
|
||||
+ public boolean isIn(net.minecraft.tags.ITag<Potion> tag) {
|
||||
+ return tag.func_230235_a_(this);
|
||||
+ }
|
||||
+
|
||||
public String func_185174_b(String p_185174_1_) {
|
||||
return p_185174_1_ + (this.field_185179_d == null ? Registry.field_212621_j.func_177774_c(this).func_110623_a() : this.field_185179_d);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -72,6 +72,8 @@
|
||||
@@ -71,6 +71,8 @@
|
||||
OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1);
|
||||
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
|
||||
OptionSpec<String> optionspec13 = optionparser.nonOptions();
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
try {
|
||||
OptionSet optionset = optionparser.parse(p_main_0_);
|
||||
@@ -79,33 +81,38 @@
|
||||
@@ -78,33 +80,38 @@
|
||||
optionparser.printHelpOn(System.err);
|
||||
return;
|
||||
}
|
||||
@@ -43,7 +43,7 @@
|
||||
- }
|
||||
-
|
||||
File file1 = new File(optionset.valueOf(optionspec9));
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString());
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY);
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(file1, MinecraftServer.field_152367_a.getName()));
|
||||
@@ -55,7 +55,16 @@
|
||||
SaveFormat saveformat = SaveFormat.func_237269_a_(file1.toPath());
|
||||
SaveFormat.LevelSave saveformat$levelsave = saveformat.func_237274_c_(s);
|
||||
MinecraftServer.func_240777_a_(saveformat$levelsave);
|
||||
@@ -170,6 +177,7 @@
|
||||
@@ -142,6 +149,8 @@
|
||||
dimensiongeneratorsettings = optionset.has(optionspec3) ? serverproperties.field_241082_U_.func_236230_k_() : serverproperties.field_241082_U_;
|
||||
}
|
||||
|
||||
+ // Forge: Deserialize the DimensionGeneratorSettings to ensure modded dims are loaded on first server load (see SimpleRegistryCodec#decode). Vanilla behaviour only loads from the server.properties and deserializes only after the 2nd server load.
|
||||
+ dimensiongeneratorsettings = DimensionGeneratorSettings.field_236201_a_.encodeStart(worldsettingsimport, dimensiongeneratorsettings).flatMap(nbt -> DimensionGeneratorSettings.field_236201_a_.parse(worldsettingsimport, nbt)).getOrThrow(false, errorMsg->{});
|
||||
iserverconfiguration = new ServerWorldInfo(worldsettings, dimensiongeneratorsettings, Lifecycle.stable());
|
||||
}
|
||||
|
||||
@@ -169,6 +178,7 @@
|
||||
Thread thread = new Thread("Server Shutdown Thread") {
|
||||
public void run() {
|
||||
dedicatedserver.func_71263_m(true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -225,7 +225,7 @@
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
public static <S extends MinecraftServer> S func_240784_a_(Function<Thread, S> p_240784_0_) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference<>();
|
||||
@@ -9,7 +9,7 @@
|
||||
atomicreference.get().func_240802_v_();
|
||||
}, "Server thread");
|
||||
thread.setUncaughtExceptionHandler((p_240779_0_, p_240779_1_) -> {
|
||||
@@ -373,6 +373,7 @@
|
||||
@@ -376,6 +376,7 @@
|
||||
worldborder.func_177737_a(new IBorderListener.Impl(serverworld1.func_175723_af()));
|
||||
this.field_71305_c.put(registrykey1, serverworld1);
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -384,6 +385,7 @@
|
||||
@@ -387,6 +388,7 @@
|
||||
} else if (p_240786_3_) {
|
||||
p_240786_1_.func_176143_a(BlockPos.field_177992_a.func_177984_a(), 0.0F);
|
||||
} else {
|
||||
@@ -25,7 +25,15 @@
|
||||
BiomeProvider biomeprovider = chunkgenerator.func_202090_b();
|
||||
Random random = new Random(p_240786_0_.func_72905_C());
|
||||
BlockPos blockpos = biomeprovider.func_225531_a_(0, p_240786_0_.func_181545_F(), 0, 256, (p_244265_0_) -> {
|
||||
@@ -563,6 +565,7 @@
|
||||
@@ -452,6 +454,7 @@
|
||||
}
|
||||
|
||||
private void func_213186_a(IChunkStatusListener p_213186_1_) {
|
||||
+ net.minecraftforge.common.world.StructureSpawnManager.gatherEntitySpawns();
|
||||
ServerWorld serverworld = this.func_241755_D_();
|
||||
field_147145_h.info("Preparing start region for dimension {}", (Object)serverworld.func_234923_W_().func_240901_a_());
|
||||
BlockPos blockpos = serverworld.func_241135_u_();
|
||||
@@ -566,6 +569,7 @@
|
||||
for(ServerWorld serverworld1 : this.func_212370_w()) {
|
||||
if (serverworld1 != null) {
|
||||
try {
|
||||
@@ -33,7 +41,7 @@
|
||||
serverworld1.close();
|
||||
} catch (IOException ioexception1) {
|
||||
field_147145_h.error("Exception closing the level", (Throwable)ioexception1);
|
||||
@@ -611,6 +614,7 @@
|
||||
@@ -614,6 +618,7 @@
|
||||
protected void func_240802_v_() {
|
||||
try {
|
||||
if (this.func_71197_b()) {
|
||||
@@ -41,7 +49,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()));
|
||||
@@ -640,7 +644,10 @@
|
||||
@@ -643,7 +648,10 @@
|
||||
this.func_240795_b_(longtickdetector);
|
||||
this.field_71296_Q = true;
|
||||
}
|
||||
@@ -52,7 +60,7 @@
|
||||
this.func_71228_a((CrashReport)null);
|
||||
}
|
||||
} catch (Throwable throwable1) {
|
||||
@@ -659,6 +666,7 @@
|
||||
@@ -662,6 +670,7 @@
|
||||
field_147145_h.error("We were unable to save this crash report to disk.");
|
||||
}
|
||||
|
||||
@@ -60,7 +68,7 @@
|
||||
this.func_71228_a(crashreport);
|
||||
} finally {
|
||||
try {
|
||||
@@ -667,6 +675,7 @@
|
||||
@@ -670,6 +679,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
field_147145_h.error("Exception stopping the server", throwable);
|
||||
} finally {
|
||||
@@ -68,7 +76,7 @@
|
||||
this.func_71240_o();
|
||||
}
|
||||
|
||||
@@ -768,6 +777,7 @@
|
||||
@@ -771,6 +781,7 @@
|
||||
|
||||
protected void func_71217_p(BooleanSupplier p_71217_1_) {
|
||||
long i = Util.func_211178_c();
|
||||
@@ -76,7 +84,7 @@
|
||||
++this.field_71315_w;
|
||||
this.func_71190_q(p_71217_1_);
|
||||
if (i - this.field_147142_T >= 5000000000L) {
|
||||
@@ -782,6 +792,7 @@
|
||||
@@ -785,6 +796,7 @@
|
||||
|
||||
Collections.shuffle(Arrays.asList(agameprofile));
|
||||
this.field_147147_p.func_151318_b().func_151330_a(agameprofile);
|
||||
@@ -84,7 +92,7 @@
|
||||
}
|
||||
|
||||
if (this.field_71315_w % 6000 == 0) {
|
||||
@@ -809,6 +820,7 @@
|
||||
@@ -812,6 +824,7 @@
|
||||
long i1 = Util.func_211178_c();
|
||||
this.field_213215_ap.func_181747_a(i1 - i);
|
||||
this.field_71304_b.func_76319_b();
|
||||
@@ -92,7 +100,7 @@
|
||||
}
|
||||
|
||||
protected void func_71190_q(BooleanSupplier p_71190_1_) {
|
||||
@@ -816,7 +828,8 @@
|
||||
@@ -819,7 +832,8 @@
|
||||
this.func_193030_aL().func_73660_a();
|
||||
this.field_71304_b.func_219895_b("levels");
|
||||
|
||||
@@ -102,7 +110,7 @@
|
||||
this.field_71304_b.func_194340_a(() -> {
|
||||
return serverworld + " " + serverworld.func_234923_W_().func_240901_a_();
|
||||
});
|
||||
@@ -827,6 +840,7 @@
|
||||
@@ -830,6 +844,7 @@
|
||||
}
|
||||
|
||||
this.field_71304_b.func_76320_a("tick");
|
||||
@@ -110,7 +118,7 @@
|
||||
|
||||
try {
|
||||
serverworld.func_72835_b(p_71190_1_);
|
||||
@@ -835,9 +849,11 @@
|
||||
@@ -838,9 +853,11 @@
|
||||
serverworld.func_72914_a(crashreport);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -122,7 +130,7 @@
|
||||
}
|
||||
|
||||
this.field_71304_b.func_219895_b("connection");
|
||||
@@ -912,7 +928,7 @@
|
||||
@@ -915,7 +932,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
@@ -131,7 +139,7 @@
|
||||
}
|
||||
|
||||
public CrashReport func_71230_b(CrashReport p_71230_1_) {
|
||||
@@ -925,6 +941,7 @@
|
||||
@@ -928,6 +945,7 @@
|
||||
p_71230_1_.func_85056_g().func_189529_a("Data Packs", () -> {
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
|
||||
@@ -139,7 +147,7 @@
|
||||
for(ResourcePackInfo resourcepackinfo : this.field_195577_ad.func_198980_d()) {
|
||||
if (stringbuilder.length() > 0) {
|
||||
stringbuilder.append(", ");
|
||||
@@ -1271,6 +1288,7 @@
|
||||
@@ -1280,6 +1298,7 @@
|
||||
this.func_184103_al().func_193244_w();
|
||||
this.field_200258_al.func_240946_a_(this.field_195576_ac.func_240960_a_());
|
||||
this.field_240765_ak_.func_195410_a(this.field_195576_ac.func_240970_h_());
|
||||
@@ -147,7 +155,7 @@
|
||||
}, this);
|
||||
if (this.func_213162_bc()) {
|
||||
this.func_213161_c(completablefuture::isDone);
|
||||
@@ -1280,10 +1298,13 @@
|
||||
@@ -1289,10 +1308,13 @@
|
||||
}
|
||||
|
||||
public static DatapackCodec func_240772_a_(ResourcePackList p_240772_0_, DatapackCodec p_240772_1_, boolean p_240772_2_) {
|
||||
@@ -163,7 +171,7 @@
|
||||
} else {
|
||||
Set<String> set = Sets.newLinkedHashSet();
|
||||
|
||||
@@ -1433,6 +1454,31 @@
|
||||
@@ -1442,6 +1464,31 @@
|
||||
|
||||
public abstract boolean func_213199_b(GameProfile p_213199_1_);
|
||||
|
||||
@@ -195,7 +203,7 @@
|
||||
public void func_223711_a(Path p_223711_1_) throws IOException {
|
||||
Path path = p_223711_1_.resolve("levels");
|
||||
|
||||
@@ -1561,6 +1607,10 @@
|
||||
@@ -1570,6 +1617,10 @@
|
||||
return this.field_240768_i_;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -76,6 +76,7 @@
|
||||
@@ -81,6 +81,7 @@
|
||||
public boolean func_71197_b() throws IOException {
|
||||
Thread thread = new Thread("Server console handler") {
|
||||
public void run() {
|
||||
@@ -8,7 +8,7 @@
|
||||
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
|
||||
|
||||
String s1;
|
||||
@@ -158,11 +159,13 @@
|
||||
@@ -162,11 +163,13 @@
|
||||
SkullTileEntity.func_184293_a(this.func_152358_ax());
|
||||
SkullTileEntity.func_184294_a(this.func_147130_as());
|
||||
PlayerProfileCache.func_187320_a(this.func_71266_T());
|
||||
@@ -22,7 +22,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);
|
||||
}
|
||||
@@ -186,11 +189,12 @@
|
||||
@@ -190,11 +193,12 @@
|
||||
}
|
||||
|
||||
Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a());
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,6 +511,11 @@
|
||||
@@ -515,6 +519,11 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
--- a/net/minecraft/server/dedicated/ServerHangWatchdog.java
|
||||
+++ b/net/minecraft/server/dedicated/ServerHangWatchdog.java
|
||||
@@ -36,7 +36,7 @@
|
||||
@@ -40,7 +40,7 @@
|
||||
ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean();
|
||||
ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true);
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
- Error error = new Error();
|
||||
- Error error = new Error("Watchdog");
|
||||
+ Error error = new Error(String.format("ServerHangWatchdog detected that a single server tick took %.2f seconds (should be max 0.05)", k / 1000F)); // Forge: don't just make a crash report with a seemingly-inexplicable Error
|
||||
|
||||
for(ThreadInfo threadinfo : athreadinfo) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/server/integrated/IntegratedServer.java
|
||||
+++ b/net/minecraft/server/integrated/IntegratedServer.java
|
||||
@@ -58,9 +58,10 @@
|
||||
@@ -56,9 +56,10 @@
|
||||
this.func_71188_g(true);
|
||||
this.func_71245_h(true);
|
||||
field_147148_h.info("Generating keypair");
|
||||
this.func_71253_a(CryptManager.func_75891_b());
|
||||
this.func_244801_P();
|
||||
+ if (!net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(this)) return false;
|
||||
this.func_240800_l__();
|
||||
this.func_71205_p(this.func_71214_G() + " - " + this.func_240793_aU_().func_76065_j());
|
||||
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
public void func_71217_p(BooleanSupplier p_71217_1_) {
|
||||
@@ -174,6 +175,7 @@
|
||||
@@ -172,6 +173,7 @@
|
||||
}
|
||||
|
||||
public void func_71263_m(boolean p_71263_1_) {
|
||||
|
||||
@@ -106,7 +106,16 @@
|
||||
if (flag2) {
|
||||
serverplayerentity.field_71135_a.func_147359_a(new SPlaySoundEffectPacket(SoundEvents.field_232818_ms_, SoundCategory.BLOCKS, (double)blockpos.func_177958_n(), (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p(), 1.0F, 1.0F));
|
||||
}
|
||||
@@ -786,7 +795,7 @@
|
||||
@@ -769,6 +778,8 @@
|
||||
this.field_192055_p.put(uuid, playeradvancements);
|
||||
}
|
||||
|
||||
+ // Forge: don't overwrite active player with a fake one.
|
||||
+ if (!(p_192054_1_ instanceof net.minecraftforge.common.util.FakePlayer))
|
||||
playeradvancements.func_192739_a(p_192054_1_);
|
||||
return playeradvancements;
|
||||
}
|
||||
@@ -786,7 +797,7 @@
|
||||
}
|
||||
|
||||
public List<ServerPlayerEntity> func_181057_v() {
|
||||
@@ -115,7 +124,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -804,6 +813,7 @@
|
||||
@@ -804,6 +815,7 @@
|
||||
}
|
||||
|
||||
this.func_148540_a(new STagsListPacket(this.field_72400_f.func_244266_aF()));
|
||||
@@ -123,7 +132,7 @@
|
||||
SUpdateRecipesPacket supdaterecipespacket = new SUpdateRecipesPacket(this.field_72400_f.func_199529_aN().func_199510_b());
|
||||
|
||||
for(ServerPlayerEntity serverplayerentity : this.field_72404_b) {
|
||||
@@ -816,4 +826,12 @@
|
||||
@@ -816,4 +828,12 @@
|
||||
public boolean func_206257_x() {
|
||||
return this.field_72407_n;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
+ return add(new TagRegistry.OptionalNamedTag<>(key, defaults));
|
||||
+ }
|
||||
+
|
||||
+ /** Call via ForgeTagHandler#makeWrapperTag to avoid any exceptions due to calling this after it is safe to call {@link #func_232937_a_(String)} */
|
||||
+ /** Call via ForgeTagHandler#makeWrapperTag to avoid any exceptions due to calling this after it is safe to call {@link #createTag(String)} */
|
||||
+ public static <T> ITag.INamedTag<T> createDelayedTag(ResourceLocation tagRegistry, ResourceLocation name) {
|
||||
+ return delayedAdd(tagRegistry, new TagRegistry.NamedTag<>(name));
|
||||
+ }
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
+ throw new IllegalStateException("Enum not extended");
|
||||
+ }
|
||||
+
|
||||
+ public static BannerPattern create(String enumName, String fileNameIn, String hashNameIn, boolean p_i231861_5_) {
|
||||
+ public static BannerPattern create(String enumName, String fileNameIn, String hashNameIn, boolean hasPatternItem) {
|
||||
+ throw new IllegalStateException("Enum not extended");
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -9,3 +9,26 @@
|
||||
private static final Logger field_206866_A = LogManager.getLogger();
|
||||
public static final TileEntityType<FurnaceTileEntity> field_200971_b = func_200966_a("furnace", TileEntityType.Builder.func_223042_a(FurnaceTileEntity::new, Blocks.field_150460_al));
|
||||
public static final TileEntityType<ChestTileEntity> field_200972_c = func_200966_a("chest", TileEntityType.Builder.func_223042_a(ChestTileEntity::new, Blocks.field_150486_ae));
|
||||
@@ -54,6 +54,7 @@
|
||||
private final Supplier<? extends T> field_200995_z;
|
||||
private final Set<Block> field_223046_I;
|
||||
private final Type<?> field_206867_C;
|
||||
+ private final net.minecraftforge.common.util.ReverseTagWrapper<TileEntityType<?>> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.TagCollectionManager.func_242178_a().getCustomTypeCollection(net.minecraftforge.registries.ForgeRegistries.TILE_ENTITIES));
|
||||
|
||||
@Nullable
|
||||
public static ResourceLocation func_200969_a(TileEntityType<?> p_200969_0_) {
|
||||
@@ -75,6 +76,14 @@
|
||||
this.field_206867_C = p_i51497_3_;
|
||||
}
|
||||
|
||||
+ public java.util.Set<net.minecraft.util.ResourceLocation> getTags() {
|
||||
+ return reverseTags.getTagNames();
|
||||
+ }
|
||||
+
|
||||
+ public boolean isIn(net.minecraft.tags.ITag<TileEntityType<?>> tag) {
|
||||
+ return tag.func_230235_a_(this);
|
||||
+ }
|
||||
+
|
||||
@Nullable
|
||||
public T func_200968_a() {
|
||||
return this.field_200995_z.get();
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/net/minecraft/util/ResourceLocation.java
|
||||
+++ b/net/minecraft/util/ResourceLocation.java
|
||||
@@ -112,6 +112,12 @@
|
||||
return i;
|
||||
}
|
||||
|
||||
+ // Normal compare sorts by path first, this compares namespace first.
|
||||
+ public int compareNamespaced(ResourceLocation o) {
|
||||
+ int ret = this.field_110626_a.compareTo(o.field_110626_a);
|
||||
+ return ret != 0 ? ret : this.field_110625_b.compareTo(o.field_110625_b);
|
||||
+ }
|
||||
+
|
||||
public static ResourceLocation func_195826_a(StringReader p_195826_0_) throws CommandSyntaxException {
|
||||
int i = p_195826_0_.getCursor();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/util/SharedConstants.java
|
||||
+++ b/net/minecraft/util/SharedConstants.java
|
||||
@@ -40,6 +40,7 @@
|
||||
@@ -44,6 +44,7 @@
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/util/math/vector/Vector4f.java
|
||||
+++ b/net/minecraft/util/math/vector/Vector4f.java
|
||||
@@ -128,4 +128,16 @@
|
||||
@@ -125,4 +125,16 @@
|
||||
public String toString() {
|
||||
return "[" + this.field_229368_a_ + ", " + this.field_229369_b_ + ", " + this.field_229370_c_ + ", " + this.field_229371_d_ + "]";
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
--- a/net/minecraft/util/registry/Bootstrap.java
|
||||
+++ b/net/minecraft/util/registry/Bootstrap.java
|
||||
@@ -48,6 +48,7 @@
|
||||
@@ -48,6 +48,8 @@
|
||||
IDispenseItemBehavior.func_218401_c();
|
||||
ArgumentTypes.func_197483_a();
|
||||
TagRegistryManager.func_242197_b();
|
||||
+ net.minecraftforge.registries.GameData.vanillaSnapshot();
|
||||
+ if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context
|
||||
func_179868_d();
|
||||
}
|
||||
}
|
||||
@@ -103,7 +104,6 @@
|
||||
@@ -103,7 +105,6 @@
|
||||
Commands.func_242986_b();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/util/registry/DynamicRegistries.java
|
||||
+++ b/net/minecraft/util/registry/DynamicRegistries.java
|
||||
@@ -90,6 +90,8 @@
|
||||
RegistryKey<? extends Registry<E>> registrykey = p_243607_2_.func_243622_a();
|
||||
boolean flag = !registrykey.equals(Registry.field_243549_ar) && !registrykey.equals(Registry.field_239698_ad_);
|
||||
Registry<E> registry = field_243600_c.func_243612_b(registrykey);
|
||||
+ if (!registrykey.equals(Registry.field_239698_ad_))
|
||||
+ registry = ((Registry<Registry<E>>)WorldGenRegistries.field_243650_b).func_230516_a_((RegistryKey<Registry<E>>)registrykey);
|
||||
MutableRegistry<E> mutableregistry = p_243607_0_.func_243612_b(registrykey);
|
||||
|
||||
for(Entry<RegistryKey<E>, E> entry : registry.func_239659_c_()) {
|
||||
@@ -248,7 +248,7 @@
|
||||
explosion.func_77278_a();
|
||||
explosion.func_77279_a(true);
|
||||
return explosion;
|
||||
@@ -562,6 +621,7 @@
|
||||
@@ -561,6 +620,7 @@
|
||||
|
||||
public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) {
|
||||
if (!func_189509_E(p_175690_1_)) {
|
||||
@@ -256,7 +256,7 @@
|
||||
if (p_175690_2_ != null && !p_175690_2_.func_145837_r()) {
|
||||
if (this.field_147481_N) {
|
||||
p_175690_2_.func_226984_a_(this, p_175690_1_);
|
||||
@@ -577,7 +637,8 @@
|
||||
@@ -576,7 +636,8 @@
|
||||
|
||||
this.field_147484_a.add(p_175690_2_);
|
||||
} else {
|
||||
@@ -266,7 +266,7 @@
|
||||
this.func_175700_a(p_175690_2_);
|
||||
}
|
||||
}
|
||||
@@ -590,6 +651,8 @@
|
||||
@@ -589,6 +650,8 @@
|
||||
if (tileentity != null && this.field_147481_N) {
|
||||
tileentity.func_145843_s();
|
||||
this.field_147484_a.remove(tileentity);
|
||||
@@ -275,7 +275,7 @@
|
||||
} else {
|
||||
if (tileentity != null) {
|
||||
this.field_147484_a.remove(tileentity);
|
||||
@@ -599,7 +662,7 @@
|
||||
@@ -598,7 +661,7 @@
|
||||
|
||||
this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
|
||||
}
|
||||
@@ -284,7 +284,7 @@
|
||||
}
|
||||
|
||||
public boolean func_195588_v(BlockPos p_195588_1_) {
|
||||
@@ -652,10 +715,10 @@
|
||||
@@ -651,10 +714,10 @@
|
||||
public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) {
|
||||
this.func_217381_Z().func_230035_c_("getEntities");
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
@@ -299,7 +299,7 @@
|
||||
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
|
||||
|
||||
for(int i1 = i; i1 <= j; ++i1) {
|
||||
@@ -672,10 +735,10 @@
|
||||
@@ -671,10 +734,10 @@
|
||||
|
||||
public <T extends Entity> List<T> func_217394_a(@Nullable EntityType<T> p_217394_1_, AxisAlignedBB p_217394_2_, Predicate<? super T> p_217394_3_) {
|
||||
this.func_217381_Z().func_230035_c_("getEntities");
|
||||
@@ -314,7 +314,7 @@
|
||||
List<T> list = Lists.newArrayList();
|
||||
|
||||
for(int i1 = i; i1 < j; ++i1) {
|
||||
@@ -692,10 +755,10 @@
|
||||
@@ -691,10 +754,10 @@
|
||||
|
||||
public <T extends Entity> List<T> func_175647_a(Class<? extends T> p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate<? super T> p_175647_3_) {
|
||||
this.func_217381_Z().func_230035_c_("getEntities");
|
||||
@@ -329,7 +329,7 @@
|
||||
List<T> list = Lists.newArrayList();
|
||||
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
|
||||
|
||||
@@ -713,10 +776,10 @@
|
||||
@@ -712,10 +775,10 @@
|
||||
|
||||
public <T extends Entity> List<T> func_225316_b(Class<? extends T> p_225316_1_, AxisAlignedBB p_225316_2_, @Nullable Predicate<? super T> p_225316_3_) {
|
||||
this.func_217381_Z().func_230035_c_("getLoadedEntities");
|
||||
@@ -344,7 +344,7 @@
|
||||
List<T> list = Lists.newArrayList();
|
||||
AbstractChunkProvider abstractchunkprovider = this.func_72863_F();
|
||||
|
||||
@@ -740,6 +803,7 @@
|
||||
@@ -739,6 +802,7 @@
|
||||
this.func_175726_f(p_175646_1_).func_76630_e();
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
}
|
||||
|
||||
public int func_181545_F() {
|
||||
@@ -784,7 +848,7 @@
|
||||
@@ -783,7 +847,7 @@
|
||||
public int func_175651_c(BlockPos p_175651_1_, Direction p_175651_2_) {
|
||||
BlockState blockstate = this.func_180495_p(p_175651_1_);
|
||||
int i = blockstate.func_185911_a(this, p_175651_1_, p_175651_2_);
|
||||
@@ -361,7 +361,7 @@
|
||||
}
|
||||
|
||||
public boolean func_175640_z(BlockPos p_175640_1_) {
|
||||
@@ -939,16 +1003,15 @@
|
||||
@@ -938,16 +1002,15 @@
|
||||
public abstract Scoreboard func_96441_U();
|
||||
|
||||
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
|
||||
@@ -382,7 +382,7 @@
|
||||
blockstate.func_215697_a(this, blockpos, p_175666_2_, p_175666_1_, false);
|
||||
}
|
||||
}
|
||||
@@ -1025,6 +1088,18 @@
|
||||
@@ -1024,6 +1087,18 @@
|
||||
return this.field_226689_w_;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
-public final class Biome {
|
||||
+public final class Biome extends net.minecraftforge.registries.ForgeRegistryEntry<Biome> {
|
||||
+public final class Biome extends net.minecraftforge.registries.ForgeRegistryEntry.UncheckedRegistryEntry<Biome> {
|
||||
public static final Logger field_150586_aC = LogManager.getLogger();
|
||||
public static final Codec<Biome> field_242418_b = RecordCodecBuilder.create((p_235064_0_) -> {
|
||||
return p_235064_0_.group(Biome.Climate.field_242459_a.forGetter((p_242446_0_) -> {
|
||||
@@ -14,9 +14,9 @@
|
||||
}), MobSpawnInfo.field_242552_c.forGetter((p_242442_0_) -> {
|
||||
return p_242442_0_.field_242425_l;
|
||||
- })).apply(p_235064_0_, Biome::new);
|
||||
+ }), ResourceLocation.field_240908_a_.fieldOf("forge:registry_name").forGetter(Biome::getRegistryName))
|
||||
+ }), ResourceLocation.field_240908_a_.optionalFieldOf("forge:registry_name").forGetter(b -> Optional.ofNullable(b.getRegistryName())))
|
||||
+ .apply(p_235064_0_, (climate, category, depth, scale, effects, gen, spawns, name) ->
|
||||
+ net.minecraftforge.common.ForgeHooks.enhanceBiome(name, climate, category, depth, scale, effects, gen, spawns, p_235064_0_, Biome::new));
|
||||
+ net.minecraftforge.common.ForgeHooks.enhanceBiome(name.orElse(null), climate, category, depth, scale, effects, gen, spawns, p_235064_0_, Biome::new));
|
||||
});
|
||||
public static final Codec<Biome> field_242419_c = RecordCodecBuilder.create((p_242432_0_) -> {
|
||||
return p_242432_0_.group(Biome.Climate.field_242459_a.forGetter((p_242441_0_) -> {
|
||||
|
||||
@@ -17,6 +17,15 @@
|
||||
chunkprimer.func_201637_h(blockpos);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +168,7 @@
|
||||
Heightmap.func_222690_a(ichunk, enumset);
|
||||
CompoundNBT compoundnbt4 = compoundnbt.func_74775_l("Structures");
|
||||
ichunk.func_201612_a(func_235967_a_(p_222656_1_, compoundnbt4, p_222656_0_.func_72905_C()));
|
||||
- ichunk.func_201606_b(func_227075_a_(p_222656_3_, compoundnbt4));
|
||||
+ net.minecraftforge.common.ForgeHooks.fixNullStructureReferences(ichunk, func_227075_a_(p_222656_3_, compoundnbt4));
|
||||
if (compoundnbt.func_74767_n("shouldSave")) {
|
||||
ichunk.func_177427_f(true);
|
||||
}
|
||||
@@ -183,6 +184,7 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/world/gen/FlatGenerationSettings.java
|
||||
+++ b/net/minecraft/world/gen/FlatGenerationSettings.java
|
||||
@@ -174,7 +174,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return (new Biome.Builder()).func_205415_a(biome.func_201851_b()).func_205419_a(biome.func_201856_r()).func_205421_a(biome.func_185355_j()).func_205420_b(biome.func_185360_m()).func_205414_c(biome.func_242445_k()).func_205417_d(biome.func_76727_i()).func_235097_a_(biome.func_235089_q_()).func_242457_a(biomegenerationsettings$builder.func_242508_a()).func_242458_a(biome.func_242433_b()).func_242455_a();
|
||||
+ return (new Biome.Builder()).func_205415_a(biome.func_201851_b()).func_205419_a(biome.func_201856_r()).func_205421_a(biome.func_185355_j()).func_205420_b(biome.func_185360_m()).func_205414_c(biome.func_242445_k()).func_205417_d(biome.func_76727_i()).func_235097_a_(biome.func_235089_q_()).func_242457_a(biomegenerationsettings$builder.func_242508_a()).func_242458_a(biome.func_242433_b()).func_242455_a().setRegistryName(biome.getRegistryName());
|
||||
}
|
||||
|
||||
public DimensionStructuresSettings func_236943_d_() {
|
||||
@@ -11,3 +11,21 @@
|
||||
chunkprimer.func_201637_h(blockpos$mutable);
|
||||
}
|
||||
|
||||
@@ -582,6 +582,9 @@
|
||||
}
|
||||
|
||||
public List<MobSpawnInfo.Spawners> func_230353_a_(Biome p_230353_1_, StructureManager p_230353_2_, EntityClassification p_230353_3_, BlockPos p_230353_4_) {
|
||||
+ List<MobSpawnInfo.Spawners> spawns = net.minecraftforge.common.world.StructureSpawnManager.getStructureSpawns(p_230353_2_, p_230353_3_, p_230353_4_);
|
||||
+ if (spawns != null) return spawns;
|
||||
+ if (false) {//Forge: We handle these hardcoded cases above in StructureSpawnManager#getStructureSpawns, but allow for insideOnly to be changed and allow for creatures to be spawned in ones other than just the witch hut
|
||||
if (p_230353_2_.func_235010_a_(p_230353_4_, true, Structure.field_236374_j_).func_75069_d()) {
|
||||
if (p_230353_3_ == EntityClassification.MONSTER) {
|
||||
return Structure.field_236374_j_.func_202279_e();
|
||||
@@ -605,6 +608,7 @@
|
||||
return Structure.field_236378_n_.func_202279_e();
|
||||
}
|
||||
}
|
||||
+ }
|
||||
|
||||
return super.func_230353_a_(p_230353_1_, p_230353_2_, p_230353_3_, p_230353_4_);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/gen/WorldGenRegion.java
|
||||
+++ b/net/minecraft/world/gen/WorldGenRegion.java
|
||||
@@ -170,11 +170,11 @@
|
||||
@@ -173,11 +173,11 @@
|
||||
|
||||
public boolean func_241212_a_(BlockPos p_241212_1_, boolean p_241212_2_, @Nullable Entity p_241212_3_, int p_241212_4_) {
|
||||
BlockState blockstate = this.func_180495_p(p_241212_1_);
|
||||
@@ -14,7 +14,7 @@
|
||||
Block.func_220054_a(blockstate, this.field_201689_f, p_241212_1_, tileentity, p_241212_3_, ItemStack.field_190927_a);
|
||||
}
|
||||
|
||||
@@ -194,11 +194,11 @@
|
||||
@@ -197,11 +197,11 @@
|
||||
if (compoundnbt != null) {
|
||||
if ("DUMMY".equals(compoundnbt.func_74779_i("id"))) {
|
||||
Block block = blockstate.func_177230_c();
|
||||
@@ -28,7 +28,7 @@
|
||||
} else {
|
||||
tileentity = TileEntity.func_235657_b_(blockstate, compoundnbt);
|
||||
}
|
||||
@@ -209,7 +209,7 @@
|
||||
@@ -212,7 +212,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
field_208303_a.warn("Tried to access a block entity before it was created. {}", (Object)p_175625_1_);
|
||||
}
|
||||
|
||||
@@ -225,9 +225,9 @@
|
||||
@@ -228,9 +228,9 @@
|
||||
}
|
||||
|
||||
Block block = p_241211_2_.func_177230_c();
|
||||
@@ -49,7 +49,7 @@
|
||||
} else {
|
||||
CompoundNBT compoundnbt = new CompoundNBT();
|
||||
compoundnbt.func_74768_a("x", p_241211_1_.func_177958_n());
|
||||
@@ -236,7 +236,7 @@
|
||||
@@ -239,7 +239,7 @@
|
||||
compoundnbt.func_74778_a("id", "DUMMY");
|
||||
ichunk.func_201591_a(compoundnbt);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java
|
||||
+++ b/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java
|
||||
@@ -104,7 +104,7 @@
|
||||
@@ -104,11 +104,11 @@
|
||||
return this.field_214953_e.size();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
TERRAIN_MATCHING("terrain_matching", ImmutableList.of(new GravityStructureProcessor(Heightmap.Type.WORLD_SURFACE_WG, -1))),
|
||||
RIGID("rigid", ImmutableList.of());
|
||||
|
||||
- public static final Codec<JigsawPattern.PlacementBehaviour> field_236858_c_ = IStringSerializable.func_233023_a_(JigsawPattern.PlacementBehaviour::values, JigsawPattern.PlacementBehaviour::func_214938_a);
|
||||
+ public static final Codec<JigsawPattern.PlacementBehaviour> field_236858_c_ = net.minecraftforge.common.IExtensibleEnum.createCodecForExtensibleEnum(JigsawPattern.PlacementBehaviour::values, JigsawPattern.PlacementBehaviour::func_214938_a);
|
||||
private static final Map<String, JigsawPattern.PlacementBehaviour> field_214939_c = Arrays.stream(values()).collect(Collectors.toMap(JigsawPattern.PlacementBehaviour::func_214936_a, (p_214935_0_) -> {
|
||||
return p_214935_0_;
|
||||
}));
|
||||
@@ -135,5 +135,15 @@
|
||||
public String func_176610_l() {
|
||||
return this.field_214940_d;
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
--- a/net/minecraft/world/gen/feature/structure/FortressStructure.java
|
||||
+++ b/net/minecraft/world/gen/feature/structure/FortressStructure.java
|
||||
@@ -30,7 +30,8 @@
|
||||
return FortressStructure.Start::new;
|
||||
}
|
||||
|
||||
- public List<MobSpawnInfo.Spawners> func_202279_e() {
|
||||
+ @Override
|
||||
+ public List<MobSpawnInfo.Spawners> getDefaultSpawnList() {
|
||||
return field_202381_d;
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
--- a/net/minecraft/world/gen/feature/structure/OceanMonumentStructure.java
|
||||
+++ b/net/minecraft/world/gen/feature/structure/OceanMonumentStructure.java
|
||||
@@ -49,7 +49,8 @@
|
||||
return OceanMonumentStructure.Start::new;
|
||||
}
|
||||
|
||||
- public List<MobSpawnInfo.Spawners> func_202279_e() {
|
||||
+ @Override
|
||||
+ public List<MobSpawnInfo.Spawners> getDefaultSpawnList() {
|
||||
return field_175803_h;
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
--- a/net/minecraft/world/gen/feature/structure/PillagerOutpostStructure.java
|
||||
+++ b/net/minecraft/world/gen/feature/structure/PillagerOutpostStructure.java
|
||||
@@ -19,7 +19,8 @@
|
||||
super(p_i231977_1_, 0, true, true);
|
||||
}
|
||||
|
||||
- public List<MobSpawnInfo.Spawners> func_202279_e() {
|
||||
+ @Override
|
||||
+ public List<MobSpawnInfo.Spawners> getDefaultSpawnList() {
|
||||
return field_214558_a;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,28 @@
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
-public abstract class Structure<C extends IFeatureConfig> {
|
||||
+public abstract class Structure<C extends IFeatureConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<Structure<?>> {
|
||||
+public abstract class Structure<C extends IFeatureConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<Structure<?>> implements net.minecraftforge.common.extensions.IForgeStructure {
|
||||
public static final BiMap<String, Structure<?>> field_236365_a_ = HashBiMap.create();
|
||||
private static final Map<Structure<?>, GenerationStage.Decoration> field_236385_u_ = Maps.newHashMap();
|
||||
private static final Logger field_208204_b = LogManager.getLogger();
|
||||
@@ -237,13 +237,18 @@
|
||||
}
|
||||
|
||||
public List<MobSpawnInfo.Spawners> func_202279_e() {
|
||||
- return ImmutableList.of();
|
||||
+ return getSpawnList(net.minecraft.entity.EntityClassification.MONSTER);
|
||||
}
|
||||
|
||||
public List<MobSpawnInfo.Spawners> func_214469_f() {
|
||||
- return ImmutableList.of();
|
||||
+ return getSpawnList(net.minecraft.entity.EntityClassification.CREATURE);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public final List<MobSpawnInfo.Spawners> getSpawnList(net.minecraft.entity.EntityClassification classification) {
|
||||
+ return net.minecraftforge.common.world.StructureSpawnManager.getSpawnList(getStructure(), classification);
|
||||
+ }
|
||||
+
|
||||
public interface IStartFactory<C extends IFeatureConfig> {
|
||||
StructureStart<C> create(Structure<C> p_create_1_, int p_create_2_, int p_create_3_, MutableBoundingBox p_create_4_, int p_create_5_, long p_create_6_);
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/world/gen/feature/structure/SwampHutStructure.java
|
||||
+++ b/net/minecraft/world/gen/feature/structure/SwampHutStructure.java
|
||||
@@ -24,11 +24,13 @@
|
||||
return SwampHutStructure.Start::new;
|
||||
}
|
||||
|
||||
- public List<MobSpawnInfo.Spawners> func_202279_e() {
|
||||
+ @Override
|
||||
+ public List<MobSpawnInfo.Spawners> getDefaultSpawnList() {
|
||||
return field_202384_d;
|
||||
}
|
||||
|
||||
- public List<MobSpawnInfo.Spawners> func_214469_f() {
|
||||
+ @Override
|
||||
+ public List<MobSpawnInfo.Spawners> getDefaultCreatureSpawnList() {
|
||||
return field_214559_aS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/server/ServerWorld.java
|
||||
+++ b/net/minecraft/world/server/ServerWorld.java
|
||||
@@ -138,7 +138,7 @@
|
||||
@@ -143,7 +143,7 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public static final BlockPos field_241108_a_ = new BlockPos(100, 50, 0);
|
||||
private static final Logger field_147491_a = LogManager.getLogger();
|
||||
private final Int2ObjectMap<Entity> field_217498_x = new Int2ObjectLinkedOpenHashMap<>();
|
||||
@@ -168,6 +168,7 @@
|
||||
@@ -173,6 +173,7 @@
|
||||
private final DragonFightManager field_241105_O_;
|
||||
private final StructureManager field_241106_P_;
|
||||
private final boolean field_241107_Q_;
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
public ServerWorld(MinecraftServer p_i241885_1_, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo p_i241885_4_, RegistryKey<World> p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List<ISpecialSpawner> p_i241885_12_, boolean p_i241885_13_) {
|
||||
super(p_i241885_4_, p_i241885_5_, p_i241885_6_, p_i241885_1_::func_213185_aS, false, p_i241885_9_, p_i241885_10_);
|
||||
@@ -195,7 +196,7 @@
|
||||
@@ -200,7 +201,7 @@
|
||||
} else {
|
||||
this.field_241105_O_ = null;
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
public void func_241113_a_(int p_241113_1_, int p_241113_2_, boolean p_241113_3_, boolean p_241113_4_) {
|
||||
@@ -291,15 +292,19 @@
|
||||
@@ -296,15 +297,19 @@
|
||||
this.field_73061_a.func_184103_al().func_232642_a_(new SChangeGameStatePacket(SChangeGameStatePacket.field_241772_i_, this.field_73017_q), this.func_234923_W_());
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
if (this.field_73068_P && this.field_217491_A.stream().noneMatch((p_241132_0_) -> {
|
||||
@@ -307,8 +312,8 @@
|
||||
@@ -312,8 +317,8 @@
|
||||
})) {
|
||||
this.field_73068_P = false;
|
||||
if (this.func_82736_K().func_223586_b(GameRules.field_223607_j)) {
|
||||
@@ -61,7 +61,7 @@
|
||||
}
|
||||
|
||||
this.func_229856_ab_();
|
||||
@@ -399,7 +404,7 @@
|
||||
@@ -404,7 +409,7 @@
|
||||
if (entity1.field_70128_L) {
|
||||
this.func_217454_n(entity1);
|
||||
objectiterator.remove();
|
||||
@@ -70,7 +70,7 @@
|
||||
}
|
||||
|
||||
iprofiler.func_76319_b();
|
||||
@@ -470,6 +475,7 @@
|
||||
@@ -475,6 +480,7 @@
|
||||
BlockPos blockpos2 = this.func_205770_a(Heightmap.Type.MOTION_BLOCKING, this.func_217383_a(i, 0, j, 15));
|
||||
BlockPos blockpos3 = blockpos2.func_177977_b();
|
||||
Biome biome = this.func_226691_t_(blockpos2);
|
||||
@@ -78,7 +78,7 @@
|
||||
if (biome.func_201848_a(this, blockpos3)) {
|
||||
this.func_175656_a(blockpos3, Blocks.field_150432_aD.func_176223_P());
|
||||
}
|
||||
@@ -593,9 +599,10 @@
|
||||
@@ -598,9 +604,10 @@
|
||||
++p_217479_1_.field_70173_aa;
|
||||
IProfiler iprofiler = this.func_217381_Z();
|
||||
iprofiler.func_194340_a(() -> {
|
||||
@@ -90,7 +90,7 @@
|
||||
p_217479_1_.func_70071_h_();
|
||||
iprofiler.func_76319_b();
|
||||
}
|
||||
@@ -682,6 +689,7 @@
|
||||
@@ -687,6 +694,7 @@
|
||||
p_217445_1_.func_200209_c(new TranslationTextComponent("menu.savingChunks"));
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
serverchunkprovider.func_217210_a(p_217445_2_);
|
||||
}
|
||||
}
|
||||
@@ -772,6 +780,7 @@
|
||||
@@ -777,6 +785,7 @@
|
||||
}
|
||||
|
||||
private void func_217448_f(ServerPlayerEntity p_217448_1_) {
|
||||
@@ -106,7 +106,7 @@
|
||||
Entity entity = this.field_175741_N.get(p_217448_1_.func_110124_au());
|
||||
if (entity != null) {
|
||||
field_147491_a.warn("Force-added player with duplicate UUID {}", (Object)p_217448_1_.func_110124_au().toString());
|
||||
@@ -796,6 +805,7 @@
|
||||
@@ -801,6 +810,7 @@
|
||||
} else if (this.func_217478_l(p_72838_1_)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -114,7 +114,7 @@
|
||||
IChunk ichunk = this.func_217353_a(MathHelper.func_76128_c(p_72838_1_.func_226277_ct_() / 16.0D), MathHelper.func_76128_c(p_72838_1_.func_226281_cx_() / 16.0D), ChunkStatus.field_222617_m, p_72838_1_.field_98038_p);
|
||||
if (!(ichunk instanceof Chunk)) {
|
||||
return false;
|
||||
@@ -811,6 +821,7 @@
|
||||
@@ -816,6 +826,7 @@
|
||||
if (this.func_217478_l(p_217440_1_)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -122,7 +122,7 @@
|
||||
this.func_217465_m(p_217440_1_);
|
||||
return true;
|
||||
}
|
||||
@@ -874,12 +885,17 @@
|
||||
@@ -879,12 +890,17 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
|
||||
this.field_175741_N.remove(p_217484_1_.func_110124_au());
|
||||
this.func_72863_F().func_217226_b(p_217484_1_);
|
||||
@@ -893,6 +909,8 @@
|
||||
@@ -898,6 +914,8 @@
|
||||
this.field_217495_I.remove(((MobEntity)p_217484_1_).func_70661_as());
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
}
|
||||
|
||||
private void func_217465_m(Entity p_217465_1_) {
|
||||
@@ -913,15 +931,19 @@
|
||||
@@ -918,15 +936,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -934,8 +956,11 @@
|
||||
@@ -939,8 +961,11 @@
|
||||
}
|
||||
|
||||
public void func_217434_e(ServerPlayerEntity p_217434_1_) {
|
||||
@@ -185,7 +185,7 @@
|
||||
this.func_72854_c();
|
||||
}
|
||||
|
||||
@@ -954,10 +979,20 @@
|
||||
@@ -959,10 +984,20 @@
|
||||
}
|
||||
|
||||
public void func_184148_a(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) {
|
||||
@@ -206,7 +206,7 @@
|
||||
this.field_73061_a.func_184103_al().func_148543_a(p_217384_1_, p_217384_2_.func_226277_ct_(), p_217384_2_.func_226278_cu_(), p_217384_2_.func_226281_cx_(), p_217384_5_ > 1.0F ? (double)(16.0F * p_217384_5_) : 16.0D, this.func_234923_W_(), new SSpawnMovingSoundEffectPacket(p_217384_3_, p_217384_4_, p_217384_2_, p_217384_5_, p_217384_6_));
|
||||
}
|
||||
|
||||
@@ -993,6 +1028,7 @@
|
||||
@@ -998,6 +1033,7 @@
|
||||
|
||||
public Explosion func_230546_a_(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) {
|
||||
Explosion explosion = new Explosion(this, p_230546_1_, p_230546_2_, p_230546_3_, p_230546_4_, p_230546_6_, p_230546_8_, p_230546_10_, p_230546_11_, p_230546_12_);
|
||||
@@ -214,7 +214,7 @@
|
||||
explosion.func_77278_a();
|
||||
explosion.func_77279_a(false);
|
||||
if (p_230546_12_ == Explosion.Mode.NONE) {
|
||||
@@ -1379,4 +1415,14 @@
|
||||
@@ -1410,4 +1446,14 @@
|
||||
p_241121_0_.func_175656_a(p_241122_1_, Blocks.field_150343_Z.func_176223_P());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.loading;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -35,5 +36,13 @@ public class BackgroundWaiter {
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
} while (!work.isDone());
|
||||
try {
|
||||
runner.shutdown();
|
||||
work.get();
|
||||
} catch (ExecutionException ee) {
|
||||
throw new RuntimeException(ee.getCause());
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,8 +29,6 @@ import java.util.List;
|
||||
*/
|
||||
public class EarlyLoadingException extends RuntimeException {
|
||||
public static class ExceptionData {
|
||||
|
||||
|
||||
private final IModInfo modInfo;
|
||||
private final String i18message;
|
||||
private final Object[] args;
|
||||
|
||||
@@ -31,6 +31,7 @@ public class FMLEnvironment
|
||||
public static final Dist dist = FMLLoader.getDist();
|
||||
public static final String naming = FMLLoader.getNaming();
|
||||
public static final boolean production = FMLLoader.isProduction() || System.getProperties().containsKey("production");
|
||||
public static final boolean secureJarsEnabled = FMLLoader.isSecureJarEnabled();
|
||||
|
||||
static void setupInteropEnvironment(IEnvironment environment) {
|
||||
environment.computePropertyIfAbsent(IEnvironment.Keys.NAMING.get(), v->naming);
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.BackgroundScanHandler;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
|
||||
import net.minecraftforge.fml.loading.progress.EarlyProgressVisualization;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.forgespi.Environment;
|
||||
@@ -53,6 +54,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -214,7 +216,7 @@ public class FMLLoader
|
||||
loadingModList = backgroundScanHandler.getLoadingModList();
|
||||
commonLaunchHandler.addLibraries(backgroundScanHandler.getModFiles().getOrDefault(IModFile.Type.LIBRARY, Collections.emptyList()));
|
||||
progressWindowTick.run();
|
||||
return backgroundScanHandler.getModFiles();
|
||||
return loadingModList.getModFiles().stream().map(ModFileInfo::getFile).collect(Collectors.groupingBy(ModFile::getType));
|
||||
}
|
||||
|
||||
public static ICoreModProvider getCoreModProvider() {
|
||||
@@ -302,4 +304,8 @@ public class FMLLoader
|
||||
public static boolean isProduction() {
|
||||
return production;
|
||||
}
|
||||
|
||||
public static boolean isSecureJarEnabled() {
|
||||
return Launcher.INSTANCE.environment().getProperty(IEnvironment.Keys.SECURED_JARS_ENABLED.get()).orElse(false);
|
||||
}
|
||||
}
|
||||
@@ -50,4 +50,8 @@ public class Java9BackportUtils
|
||||
emptyAction.run();
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> Stream<T> toStream(final Optional<T> optional) {
|
||||
return optional.map(Stream::of).orElseGet(Stream::empty);
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ public class LanguageLoadingProvider
|
||||
LOGGER.error("Missing language {} version {} wanted by {}", modLoader, modLoaderVersion, languageFileName);
|
||||
throw new EarlyLoadingException("Missing language "+modLoader, null, Collections.singletonList(new EarlyLoadingException.ExceptionData("fml.language.missingversion", modLoader, modLoaderVersion, languageFileName, "null")));
|
||||
}
|
||||
if (!modLoaderVersion.containsVersion(mlw.getVersion())) {
|
||||
if (!VersionSupportMatrix.testVersionSupportMatrix(modLoaderVersion, modLoader, "languageloader", (llid, range) -> range.containsVersion(mlw.getVersion()))) {
|
||||
LOGGER.error("Missing language {} version {} wanted by {}, found {}", modLoader, modLoaderVersion, languageFileName, mlw.getVersion());
|
||||
throw new EarlyLoadingException("Missing language "+ modLoader + " matching range "+modLoaderVersion + " found "+mlw.getVersion(), null, Collections.singletonList(new EarlyLoadingException.ExceptionData("fml.language.missingversion", modLoader, modLoaderVersion, languageFileName, mlw.getVersion())));
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.loading;
|
||||
|
||||
import cpw.mods.modlauncher.api.LamdbaExceptionUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -29,6 +30,7 @@ import java.net.URLConnection;
|
||||
import java.net.URLStreamHandler;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
@@ -43,6 +45,18 @@ public class ModJarURLHandler extends URLStreamHandler
|
||||
return new ModJarURLConnection(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int hashCode(final URL u) {
|
||||
return Objects.hash(u.getHost(), u.getFile());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean equals(final URL u1, final URL u2) {
|
||||
return Objects.equals(u1.getProtocol(), u2.getProtocol())
|
||||
&& Objects.equals(u1.getHost(), u2.getHost())
|
||||
&& Objects.equals(u1.getFile(), u2.getFile());
|
||||
}
|
||||
|
||||
static class ModJarURLConnection extends URLConnection {
|
||||
private Path resource;
|
||||
private String modpath;
|
||||
@@ -83,6 +97,12 @@ public class ModJarURLHandler extends URLStreamHandler
|
||||
}
|
||||
}
|
||||
|
||||
// Used to cache protectiondomains by "top level object" aka the modid
|
||||
@Override
|
||||
public URL getURL() {
|
||||
return LamdbaExceptionUtils.uncheck(()->new URL("modjar://"+modid));
|
||||
}
|
||||
|
||||
public Optional<Manifest> getManifest() {
|
||||
return manifest;
|
||||
}
|
||||
|
||||
@@ -36,17 +36,11 @@ import org.apache.logging.log4j.util.StringBuilderFormattable;
|
||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
|
||||
@@ -56,6 +50,7 @@ public class ModSorter
|
||||
private List<ModFile> modFiles;
|
||||
private List<ModInfo> sortedList;
|
||||
private Map<String, ModInfo> modIdNameLookup;
|
||||
private List<ModFile> forgeAndMC;
|
||||
|
||||
private ModSorter(final List<ModFile> modFiles)
|
||||
{
|
||||
@@ -65,21 +60,41 @@ public class ModSorter
|
||||
public static LoadingModList sort(List<ModFile> mods)
|
||||
{
|
||||
final ModSorter ms = new ModSorter(mods);
|
||||
EarlyLoadingException earlyLoadingException = null;
|
||||
try {
|
||||
ms.findLanguages();
|
||||
ms.buildUniqueList();
|
||||
ms.verifyDependencyVersions();
|
||||
ms.sort();
|
||||
} catch (EarlyLoadingException ele) {
|
||||
earlyLoadingException = ele;
|
||||
ms.sortedList = Collections.emptyList();
|
||||
} catch (EarlyLoadingException e) {
|
||||
// We cannot build any list with duped mods. We have to abort immediately and report it
|
||||
return LoadingModList.of(ms.forgeAndMC, ms.forgeAndMC.stream().map(mf->(ModInfo)mf.getModInfos().get(0)).collect(Collectors.toList()), e);
|
||||
}
|
||||
// try and locate languages and validate dependencies
|
||||
List<EarlyLoadingException.ExceptionData> missingLangs = ms.findLanguages();
|
||||
List<EarlyLoadingException.ExceptionData> missingDeps = ms.verifyDependencyVersions();
|
||||
final List<ExceptionData> failedList = Stream.concat(missingLangs.stream(), missingDeps.stream()).collect(Collectors.toList());
|
||||
// if we miss one or the other, we abort now
|
||||
if (!failedList.isEmpty()) {
|
||||
return LoadingModList.of(ms.forgeAndMC, ms.forgeAndMC.stream().map(mf->(ModInfo)mf.getModInfos().get(0)).collect(Collectors.toList()), new EarlyLoadingException("failure to validate mod list", null, failedList));
|
||||
} else {
|
||||
// Otherwise, lets try and sort the modlist and proceed
|
||||
EarlyLoadingException earlyLoadingException = null;
|
||||
try {
|
||||
ms.sort();
|
||||
} catch (EarlyLoadingException e) {
|
||||
earlyLoadingException = e;
|
||||
}
|
||||
return LoadingModList.of(ms.modFiles, ms.sortedList, earlyLoadingException);
|
||||
}
|
||||
return LoadingModList.of(ms.modFiles, ms.sortedList, earlyLoadingException);
|
||||
}
|
||||
|
||||
private void findLanguages() {
|
||||
modFiles.forEach(ModFile::identifyLanguage);
|
||||
private List<EarlyLoadingException.ExceptionData> findLanguages() {
|
||||
List<EarlyLoadingException.ExceptionData> errorData = new ArrayList<>();
|
||||
modFiles.forEach(modFile -> {
|
||||
try {
|
||||
modFile.identifyLanguage();
|
||||
} catch (EarlyLoadingException e) {
|
||||
errorData.addAll(e.getAllData());
|
||||
}
|
||||
});
|
||||
return errorData;
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
@@ -167,6 +182,11 @@ public class ModSorter
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(mf -> mf.getModInfos().get(0).getModId()));
|
||||
|
||||
// Capture forge and MC here, so we can keep them for later
|
||||
forgeAndMC = new ArrayList<>();
|
||||
forgeAndMC.add((ModFile)modFilesByFirstId.get("minecraft").get(0));
|
||||
forgeAndMC.add((ModFile)modFilesByFirstId.get("forge").get(0));
|
||||
|
||||
// Select the newest by artifact version sorting of non-unique files thus identified
|
||||
this.modFiles = modFilesByFirstId.entrySet().stream()
|
||||
.map(this::selectNewestModInfo)
|
||||
@@ -213,7 +233,7 @@ public class ModSorter
|
||||
return new AbstractMap.SimpleImmutableEntry<>(fullList.getKey(), modInfoList.get(0));
|
||||
}
|
||||
|
||||
private void verifyDependencyVersions()
|
||||
private List<EarlyLoadingException.ExceptionData> verifyDependencyVersions()
|
||||
{
|
||||
final Map<String, ArtifactVersion> modVersions = modFiles
|
||||
.stream()
|
||||
@@ -237,24 +257,24 @@ public class ModSorter
|
||||
LOGGER.debug(LOADING, "Found {} mandatory requirements", mandatoryModVersions.size());
|
||||
final Set<IModInfo.ModVersion> missingVersions = mandatoryModVersions
|
||||
.stream()
|
||||
.filter(mv->this.modVersionMatches(mv, modVersions))
|
||||
.filter(mv->this.modVersionNotContained(mv, modVersions))
|
||||
.collect(Collectors.toSet());
|
||||
LOGGER.debug(LOADING, "Found {} mandatory mod requirements missing", missingVersions.size());
|
||||
|
||||
if (!missingVersions.isEmpty()) {
|
||||
final List<EarlyLoadingException.ExceptionData> exceptionData = missingVersions
|
||||
return missingVersions
|
||||
.stream()
|
||||
.map(mv -> new EarlyLoadingException.ExceptionData("fml.modloading.missingdependency", mv.getOwner(),
|
||||
.map(mv -> new ExceptionData("fml.modloading.missingdependency", mv.getOwner(),
|
||||
mv.getModId(), mv.getOwner().getModId(), mv.getVersionRange(),
|
||||
modVersions.getOrDefault(mv.getModId(), new DefaultArtifactVersion("null"))))
|
||||
.collect(Collectors.toList());
|
||||
throw new EarlyLoadingException("Missing mods", null, exceptionData);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private boolean modVersionMatches(final IModInfo.ModVersion mv, final Map<String, ArtifactVersion> modVersions)
|
||||
private boolean modVersionNotContained(final IModInfo.ModVersion mv, final Map<String, ArtifactVersion> modVersions)
|
||||
{
|
||||
return !(modVersions.containsKey(mv.getModId()) &&
|
||||
(mv.getVersionRange().containsVersion(modVersions.get(mv.getModId())) || modVersions.get(mv.getModId()).toString().equals("NONE")));
|
||||
return !(VersionSupportMatrix.testVersionSupportMatrix(mv.getVersionRange(), mv.getModId(), "mod", (modId, range) -> modVersions.containsKey(modId) &&
|
||||
(range.containsVersion(modVersions.get(modId)) || modVersions.get(modId).toString().equals("NONE"))));
|
||||
}
|
||||
}
|
||||
@@ -55,4 +55,13 @@ public class StringUtils
|
||||
public static String parseStringFormat(final String input, final Map<String, String> properties) {
|
||||
return StrSubstitutor.replace(input, properties);
|
||||
}
|
||||
|
||||
public static String binToHex(final byte[] bytes) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
sb.append(Integer.toHexString((bytes[i]&0xf0) >>4));
|
||||
sb.append(Integer.toHexString(bytes[i]&0x0f));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.minecraftforge.fml.loading;
|
||||
|
||||
import net.minecraftforge.forgespi.language.MavenVersionAdapter;
|
||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.VersionRange;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.function.BiPredicate;
|
||||
|
||||
public class VersionSupportMatrix {
|
||||
private static final HashMap<String, ArtifactVersion> overrideVersions = new HashMap<>();
|
||||
static {
|
||||
final ArtifactVersion version = new DefaultArtifactVersion(FMLLoader.mcVersion);
|
||||
if (MavenVersionAdapter.createFromVersionSpec("[1.16.4]").containsVersion(version)) {
|
||||
overrideVersions.put("languageloader.javafml", new DefaultArtifactVersion("34")); // we also work with javafml 34
|
||||
overrideVersions.put("mod.minecraft", new DefaultArtifactVersion("1.16.3")); // we work with anything declaring 1.16.3
|
||||
overrideVersions.put("mod.forge", new DefaultArtifactVersion("34.1.42")); // we work with anything that supports forge 34.1.42
|
||||
}
|
||||
}
|
||||
public static <T> boolean testVersionSupportMatrix(VersionRange declaredRange, String lookupId, String type, BiPredicate<String, VersionRange> standardLookup) {
|
||||
return standardLookup.test(lookupId, declaredRange) || overrideVersions.containsKey(type +"." +lookupId) && declaredRange.containsVersion(overrideVersions.get(type +"." +lookupId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2020.
|
||||
*
|
||||
* 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.log4j;
|
||||
|
||||
import net.minecrell.terminalconsole.HighlightErrorConverter;
|
||||
import net.minecrell.terminalconsole.TerminalConsoleAppender;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.core.config.Configuration;
|
||||
import org.apache.logging.log4j.core.config.plugins.Plugin;
|
||||
import org.apache.logging.log4j.core.pattern.ConverterKeys;
|
||||
import org.apache.logging.log4j.core.pattern.HighlightConverter;
|
||||
import org.apache.logging.log4j.core.pattern.PatternConverter;
|
||||
import org.apache.logging.log4j.status.StatusLogger;
|
||||
import org.apache.logging.log4j.util.PerformanceSensitive;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A wrapper for {@link HighlightConverter} that auto-disables ANSI when the terminal doesn't support it.
|
||||
* Ansi support is determined by TerminalConsoleAppender
|
||||
*/
|
||||
@Plugin(name = "highlightForge", category = PatternConverter.CATEGORY)
|
||||
@ConverterKeys("highlightForge")
|
||||
@PerformanceSensitive("allocation")
|
||||
public class ForgeHighlight {
|
||||
protected static final Logger LOGGER = StatusLogger.getLogger();
|
||||
|
||||
/**
|
||||
* Gets a new instance of the {@link HighlightErrorConverter} with the
|
||||
* specified options.
|
||||
*
|
||||
* @param config The current configuration
|
||||
* @param options The pattern options
|
||||
* @return The new instance
|
||||
*/
|
||||
public static @Nullable HighlightConverter newInstance(Configuration config, String[] options) {
|
||||
try {
|
||||
Method method = TerminalConsoleAppender.class.getDeclaredMethod("initializeTerminal");
|
||||
method.setAccessible(true);
|
||||
method.invoke(null);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
LOGGER.warn("Failed to invoke initializeTerminal on TCA", e);
|
||||
}
|
||||
if (!TerminalConsoleAppender.isAnsiSupported() && Arrays.stream(options).noneMatch(s -> s.equals("disableAnsi=true"))) {
|
||||
List<String> optionList = new ArrayList<>();
|
||||
optionList.add(options[0]);
|
||||
optionList.add("disableAnsi=true");
|
||||
options = optionList.toArray(new String[0]);
|
||||
}
|
||||
return HighlightConverter.newInstance(config, options);
|
||||
}
|
||||
}
|
||||
+22
-2
@@ -19,20 +19,25 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import cpw.mods.modlauncher.api.LamdbaExceptionUtils;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.forgespi.locating.IModLocator;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.security.CodeSigner;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.Manifest;
|
||||
import java.util.stream.Stream;
|
||||
@@ -79,16 +84,31 @@ public abstract class AbstractJarFileLocator implements IModLocator {
|
||||
LOGGER.debug(SCAN,"Scan finished: {}", file);
|
||||
}
|
||||
|
||||
static final Method ENSURE_INIT = LamdbaExceptionUtils.uncheck(()->JarFile.class.getDeclaredMethod("ensureInitialization"));
|
||||
static {
|
||||
ENSURE_INIT.setAccessible(true);
|
||||
}
|
||||
@Override
|
||||
public Optional<Manifest> findManifest(final Path file)
|
||||
{
|
||||
return findManifestAndSigners(file).getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<Optional<Manifest>, Optional<CodeSigner[]>> findManifestAndSigners(final Path file) {
|
||||
try (JarFile jf = new JarFile(file.toFile()))
|
||||
{
|
||||
return Optional.ofNullable(jf.getManifest());
|
||||
final Manifest manifest = jf.getManifest();
|
||||
if (manifest!=null) {
|
||||
final JarEntry jarEntry = jf.getJarEntry(JarFile.MANIFEST_NAME);
|
||||
LamdbaExceptionUtils.uncheck(() -> ENSURE_INIT.invoke(jf));
|
||||
return Pair.of(Optional.of(manifest), Optional.ofNullable(jarEntry.getCodeSigners()));
|
||||
}
|
||||
return Pair.of(Optional.empty(), Optional.empty());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return Optional.empty();
|
||||
return Pair.of(Optional.empty(), Optional.empty());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ public enum InvalidModIdentifier {
|
||||
FABRIC(filePresent("fabric.mod.json")),
|
||||
LITELOADER(filePresent("litemod.json")),
|
||||
OPTIFINE(filePresent("optifine/Installer.class")),
|
||||
BUKKIT(filePresent("plugin.yml")),
|
||||
INVALIDZIP((f,zf) -> !zf.isPresent());
|
||||
|
||||
private BiPredicate<Path, Optional<ZipFile>> ident;
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.forgespi.Environment;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.forgespi.locating.IModLocator;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -45,6 +46,7 @@ import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.CodeSigner;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -57,6 +59,8 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.Manifest;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -215,6 +219,24 @@ public class ModDiscoverer {
|
||||
LOGGER.debug(SCAN,"Scan finished: {}", modFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<Optional<Manifest>, Optional<CodeSigner[]>> findManifestAndSigners(final Path file) {
|
||||
if (Files.isDirectory(mcJar)) {
|
||||
return Pair.of(Optional.empty(), Optional.empty());
|
||||
}
|
||||
try (JarFile jf = new JarFile(mcJar.toFile())) {
|
||||
final Manifest manifest = jf.getManifest();
|
||||
if (manifest!=null) {
|
||||
final JarEntry jarEntry = jf.getJarEntry(JarFile.MANIFEST_NAME);
|
||||
LamdbaExceptionUtils.uncheck(() -> AbstractJarFileLocator.ENSURE_INIT.invoke(jf));
|
||||
return Pair.of(Optional.of(manifest), Optional.ofNullable(jarEntry.getCodeSigners()));
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
return Pair.of(Optional.empty(), Optional.empty());
|
||||
}
|
||||
return Pair.of(Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Manifest> findManifest(final Path file) {
|
||||
return Optional.empty();
|
||||
|
||||
@@ -20,16 +20,29 @@
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import cpw.mods.modlauncher.api.LamdbaExceptionUtils;
|
||||
import net.minecraftforge.fml.loading.Java9BackportUtils;
|
||||
import net.minecraftforge.fml.loading.StringUtils;
|
||||
import net.minecraftforge.forgespi.language.IConfigurable;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import net.minecraftforge.forgespi.language.MavenVersionAdapter;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.maven.artifact.versioning.VersionRange;
|
||||
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
import java.net.URL;
|
||||
import java.security.CodeSigner;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.SignatureException;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -55,6 +68,7 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
// Caches the manifest of the mod jar as parsing the manifest can be expensive for
|
||||
// signed jars.
|
||||
private final Optional<Manifest> manifest;
|
||||
private final Optional<CodeSigner[]> signers;
|
||||
|
||||
ModFileInfo(final ModFile modFile, final IConfigurable config)
|
||||
{
|
||||
@@ -83,7 +97,9 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
this.modFile::getFileName,
|
||||
() -> this.mods.stream().map(IModInfo::getModId).collect(Collectors.joining(",", "{", "}")),
|
||||
() -> this.mods.stream().map(IModInfo::getVersion).map(Objects::toString).collect(Collectors.joining(",", "{", "}")));
|
||||
this.manifest = modFile.getLocator().findManifest(modFile.getFilePath());
|
||||
final Pair<Optional<Manifest>, Optional<CodeSigner[]>> manifestAndSigners = modFile.getLocator().findManifestAndSigners(modFile.getFilePath());
|
||||
this.manifest = manifestAndSigners.getKey();
|
||||
this.signers = manifestAndSigners.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,4 +169,42 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
{
|
||||
return Strings.isNullOrEmpty(license);
|
||||
}
|
||||
|
||||
public Optional<CodeSigner[]> getCodeSigners() {
|
||||
return this.signers;
|
||||
}
|
||||
|
||||
public Optional<String> getCodeSigningFingerprint() {
|
||||
return Java9BackportUtils.toStream(this.signers)
|
||||
.flatMap(csa->csa[0].getSignerCertPath().getCertificates().stream())
|
||||
.findFirst()
|
||||
.map(LamdbaExceptionUtils.rethrowFunction(Certificate::getEncoded))
|
||||
.map(bytes->LamdbaExceptionUtils.uncheck(()->MessageDigest.getInstance("SHA-256")).digest(bytes))
|
||||
.map(StringUtils::binToHex)
|
||||
.map(str-> String.join(":", str.split("(?<=\\G.{2})")));
|
||||
}
|
||||
|
||||
public Optional<String> getTrustData() {
|
||||
return Java9BackportUtils.toStream(this.signers)
|
||||
.flatMap(csa->csa[0].getSignerCertPath().getCertificates().stream())
|
||||
.findFirst()
|
||||
.map(X509Certificate.class::cast)
|
||||
.map(c->{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(c.getSubjectX500Principal().getName(X500Principal.RFC2253).split(",")[0]);
|
||||
boolean selfSigned = false;
|
||||
try {
|
||||
c.verify(c.getPublicKey());
|
||||
selfSigned = true;
|
||||
} catch (CertificateException | NoSuchAlgorithmException | InvalidKeyException | SignatureException | NoSuchProviderException e) {
|
||||
// not self signed
|
||||
}
|
||||
if (selfSigned) {
|
||||
sb.append(" self-signed");
|
||||
} else {
|
||||
sb.append(" signed by ").append(c.getIssuerX500Principal().getName(X500Principal.RFC2253).split(",")[0]);
|
||||
};
|
||||
return sb.toString();
|
||||
});
|
||||
}
|
||||
}
|
||||
+28
-11
@@ -24,15 +24,12 @@ import com.google.common.base.CharMatcher;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class StartupMessageManager {
|
||||
private static final EnumMap<MessageType, List<Message>> messages = new EnumMap<>(MessageType.class);
|
||||
static {
|
||||
Arrays.stream(MessageType.values()).forEach(mt->messages.computeIfAbsent(mt, k->new CopyOnWriteArrayList<>()));
|
||||
}
|
||||
|
||||
private static volatile EnumMap<MessageType, List<Message>> messages = new EnumMap<>(MessageType.class);
|
||||
|
||||
public static List<Pair<Integer,Message>> getMessages() {
|
||||
final long ts = System.nanoTime();
|
||||
@@ -88,22 +85,42 @@ public class StartupMessageManager {
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized static void addMessage(MessageType type, String message, int maxSize)
|
||||
{
|
||||
EnumMap<MessageType, List<Message>> newMessages = new EnumMap<>(messages);
|
||||
newMessages.compute(type, (key, existingList) -> {
|
||||
List<Message> newList = new ArrayList<>();
|
||||
if (existingList != null)
|
||||
{
|
||||
if (maxSize < 0)
|
||||
{
|
||||
newList.addAll(existingList);
|
||||
}
|
||||
else
|
||||
{
|
||||
newList.addAll(existingList.subList(0, Math.min(existingList.size(), maxSize)));
|
||||
}
|
||||
}
|
||||
newList.add(new Message(message, type));
|
||||
return newList;
|
||||
});
|
||||
messages = newMessages;
|
||||
}
|
||||
|
||||
public static void addModMessage(final String message) {
|
||||
final String safeMessage = Ascii.truncate(CharMatcher.ascii().retainFrom(message),80,"~");
|
||||
final List<Message> messages = StartupMessageManager.messages.get(MessageType.MOD);
|
||||
messages.subList(0, Math.max(0, messages.size() - 20)).clear();
|
||||
messages.add(new Message(safeMessage, MessageType.MOD));
|
||||
addMessage(MessageType.MOD, safeMessage, 20);
|
||||
}
|
||||
|
||||
public static Optional<Consumer<String>> modLoaderConsumer() {
|
||||
return Optional.of(s-> messages.get(MessageType.ML).add(new Message(s, MessageType.ML)));
|
||||
return Optional.of(s-> addMessage(MessageType.ML, s, -1));
|
||||
}
|
||||
|
||||
public static Optional<Consumer<String>> locatorConsumer() {
|
||||
return Optional.of(s -> messages.get(MessageType.LOC).add(new Message(s, MessageType.LOC)));
|
||||
return Optional.of(s -> addMessage(MessageType.LOC, s, -1));
|
||||
}
|
||||
|
||||
public static Optional<Consumer<String>> mcLoaderConsumer() {
|
||||
return Optional.of(s-> messages.get(MessageType.MC).add(new Message(s, MessageType.MC)));
|
||||
return Optional.of(s-> addMessage(MessageType.MC, s, -1));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="warn" packages="net.minecrell.terminalconsole,net.minecrell.terminalconsole.util,com.mojang.util,cpw.mods.modlauncher.log" shutdownHook="disable">
|
||||
<Configuration status="warn" packages="net.minecrell.terminalconsole,net.minecrell.terminalconsole.util,com.mojang.util,cpw.mods.modlauncher.log,net.minecraftforge.fml.loading.log4j" shutdownHook="disable">
|
||||
<filters>
|
||||
<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
|
||||
<MarkerFilter marker="NETWORK_PACKETS" onMatch="${sys:forge.logging.marker.networking:-DENY}" onMismatch="NEUTRAL"/>
|
||||
@@ -20,10 +20,10 @@
|
||||
<Appenders>
|
||||
<TerminalConsole name="Console">
|
||||
<PatternLayout>
|
||||
<LoggerNamePatternSelector defaultPattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [%c{2.}/%markerSimpleName]: %minecraftFormatting{%msg}%n%tEx}">
|
||||
<LoggerNamePatternSelector defaultPattern="%highlightForge{[%d{HH:mm:ss}] [%t/%level] [%c{2.}/%markerSimpleName]: %minecraftFormatting{%msg}%n%tEx}">
|
||||
<!-- don't include the full logger name for Mojang's logs since they use full class names and it's very verbose -->
|
||||
<PatternMatch key="net.minecraft." pattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [minecraft/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}"/>
|
||||
<PatternMatch key="com.mojang." pattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [mojang/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}"/>
|
||||
<PatternMatch key="net.minecraft." pattern="%highlightForge{[%d{HH:mm:ss}] [%t/%level] [minecraft/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}"/>
|
||||
<PatternMatch key="com.mojang." pattern="%highlightForge{[%d{HH:mm:ss}] [%t/%level] [mojang/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}"/>
|
||||
</LoggerNamePatternSelector>
|
||||
</PatternLayout>
|
||||
</TerminalConsole>
|
||||
|
||||
@@ -63,13 +63,22 @@ bf2e445b48b024354a69138b20a4a4a8aa5d15d1 assets/minecraft/blockstates/oak_trapdo
|
||||
9c4cc92efb78811e8d70a383a1a89eb75b69db04 assets/minecraft/blockstates/stone.json
|
||||
570fdd86046df75a073b759ff7aaf4c4caf43115 assets/minecraft/blockstates/torch.json
|
||||
a012d6d92bab1c91913bd0f2dc0492a0fce916f2 assets/minecraft/blockstates/wall_torch.json
|
||||
e615d11ed9a452bca5d8b242e733a43ba2df19a3 assets/new_model_loader_test/blockstates/obj_block.json
|
||||
bab7cd04569c8aa63320772acdc3c91a5ceda14a assets/new_model_loader_test/models/block/obj_block.json
|
||||
9fa44308a52fbc384d5befee4e117531642299fb assets/new_model_loader_test/models/item/item_layers.json
|
||||
70c8c81f3a157e4d698f213d5c1a13c13eaa5157 assets/new_model_loader_test/models/item/separate_perspective.json
|
||||
273e0ed992d227f09f1c83bc22d066fb68d03c84 assets/piston_event_test/blockstates/shiftonmove.json
|
||||
d2c8e860521c5e738ed0798337f5728d610825ff assets/piston_event_test/models/block/shiftonmove.json
|
||||
f51f026a75e27a0a53a76771d553c0e3385a2966 assets/piston_event_test/models/item/shiftonmove.json
|
||||
cf16f861eaf5815238c2278eb48bde0688cb73b7 assets/scaffolding_test/blockstates/scaffolding_method_test.json
|
||||
862196702dcd5538c5ceb4ac6202e57eb5c8a97f data/custom_tag_types_test/tags/custom_tag_types_test/custom_types/tests.json
|
||||
8c1969250406edfbd470cc06aca4dcccfd6ce682 data/custom_tag_types_test/tags/enchantments/fire.json
|
||||
44985f1cb0df54b632187ed97a6a443455f1e51c data/custom_tag_types_test/tags/potions/damage.json
|
||||
9405b72d54aad3f4377035d9707bb9947e9032a3 data/custom_tag_types_test/tags/tile_entity_types/storage.json
|
||||
4fbaf6f4a3ea05cc071076e27f44ac81f9cc50e3 data/data_gen_test/advancements/conditional.json
|
||||
66442c8000af9af4ba36109b3c9d09d9ffd57277 data/data_gen_test/advancements/recipes/conditional2.json
|
||||
ed4cbf1a3a2f5d8969f6346fdc9acdbe81d0c919 data/data_gen_test/recipes/conditional.json
|
||||
ca9827bff0a49957e01cf3887ef5131ad8710320 data/data_gen_test/recipes/conditional2.json
|
||||
40208299608468b044f64317995f9182ec219d90 data/data_gen_test/tags/blocks/test.json
|
||||
d65c425e740dc833f29d16606a1171825876be0d data/data_gen_test/tags/blocks/thing/one.json
|
||||
1f70ed4ddc878bada5e43d3c44a34157806beda8 data/data_gen_test/tags/blocks/thing/three.json
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "new_model_loader_test:block/obj_block"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"textures": {
|
||||
"qr": "minecraft:block/oak_planks",
|
||||
"particle": "#qr"
|
||||
},
|
||||
"loader": "forge:obj",
|
||||
"model": "new_model_loader_test:models/item/sugar_glider.obj",
|
||||
"flip-v": true
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"parent": "forge:item/default",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/coal",
|
||||
"layer1": "minecraft:item/stick"
|
||||
},
|
||||
"loader": "forge:item-layers",
|
||||
"fullbright_layers": [
|
||||
1
|
||||
]
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"parent": "forge:item/default",
|
||||
"loader": "forge:separate-perspective",
|
||||
"base": {
|
||||
"parent": "minecraft:item/coal"
|
||||
},
|
||||
"perspectives": {
|
||||
"gui": {
|
||||
"parent": "minecraft:item/snowball"
|
||||
},
|
||||
"first_person_left_hand": {
|
||||
"parent": "minecraft:item/bone"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:fire_aspect",
|
||||
"minecraft:flame"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:harming",
|
||||
"minecraft:strong_harming"
|
||||
]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:barrel",
|
||||
"minecraft:chest",
|
||||
"minecraft:ender_chest"
|
||||
]
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"advancements": [
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"value": {
|
||||
"values": [
|
||||
{
|
||||
"value": {
|
||||
"modid": "minecraft",
|
||||
"type": "forge:mod_loaded"
|
||||
},
|
||||
"type": "forge:not"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dirt",
|
||||
"type": "forge:item_exists"
|
||||
},
|
||||
{
|
||||
"type": "forge:false"
|
||||
}
|
||||
],
|
||||
"type": "forge:and"
|
||||
},
|
||||
"type": "forge:not"
|
||||
}
|
||||
],
|
||||
"advancement": {
|
||||
"parent": "minecraft:recipes/root",
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:diamond_block"
|
||||
]
|
||||
},
|
||||
"criteria": {
|
||||
"has_dirt": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "minecraft:dirt"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"trigger": "minecraft:recipe_unlocked",
|
||||
"conditions": {
|
||||
"recipe": "minecraft:diamond_block"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_dirt",
|
||||
"has_the_recipe"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"type": "forge:conditional",
|
||||
"recipes": [
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"value": {
|
||||
"values": [
|
||||
{
|
||||
"value": {
|
||||
"modid": "minecraft",
|
||||
"type": "forge:mod_loaded"
|
||||
},
|
||||
"type": "forge:not"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dirt",
|
||||
"type": "forge:item_exists"
|
||||
},
|
||||
{
|
||||
"type": "forge:false"
|
||||
}
|
||||
],
|
||||
"type": "forge:and"
|
||||
},
|
||||
"type": "forge:not"
|
||||
}
|
||||
],
|
||||
"recipe": {
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"XXX",
|
||||
"XXX",
|
||||
"XXX"
|
||||
],
|
||||
"key": {
|
||||
"X": {
|
||||
"item": "minecraft:dirt"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "minecraft:diamond_block",
|
||||
"count": 64
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.client.gui.ClientBossInfo;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.screen.MainMenuScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.network.play.NetworkPlayerInfo;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.client.renderer.FogRenderer.FogType;
|
||||
import net.minecraft.client.renderer.color.BlockColors;
|
||||
@@ -51,6 +52,7 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.ai.attributes.ModifiableAttributeInstance;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
@@ -72,11 +74,13 @@ import net.minecraft.util.math.vector.Vector3f;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.GameType;
|
||||
import net.minecraft.world.IBlockDisplayReader;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.event.sound.PlaySoundEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.model.TransformationHelper;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
@@ -237,10 +241,10 @@ public class ForgeHooksClient
|
||||
if (status == BETA || status == BETA_OUTDATED)
|
||||
{
|
||||
// render a warning at the top of the screen,
|
||||
ITextComponent line = new TranslationTextComponent("forge.update.beta.1", TextFormatting.RED, TextFormatting.RESET).func_240699_a_(TextFormatting.RED);
|
||||
AbstractGui.func_238472_a_(mStack, font, line, width / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1);
|
||||
ITextComponent line = new TranslationTextComponent("forge.update.beta.1", TextFormatting.RED, TextFormatting.RESET).mergeStyle(TextFormatting.RED);
|
||||
AbstractGui.drawCenteredString(mStack, font, line, width / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1);
|
||||
line = new TranslationTextComponent("forge.update.beta.2");
|
||||
AbstractGui.func_238472_a_(mStack, font, line, width / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1);
|
||||
AbstractGui.drawCenteredString(mStack, font, line, width / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1);
|
||||
}
|
||||
|
||||
String line = null;
|
||||
@@ -276,7 +280,7 @@ public class ForgeHooksClient
|
||||
public static void drawScreen(Screen screen, MatrixStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Pre(screen, mStack, mouseX, mouseY, partialTicks)))
|
||||
screen.func_230430_a_(mStack, mouseX, mouseY, partialTicks);
|
||||
screen.render(mStack, mouseX, mouseY, partialTicks);
|
||||
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Post(screen, mStack, mouseX, mouseY, partialTicks));
|
||||
}
|
||||
|
||||
@@ -562,6 +566,15 @@ public class ForgeHooksClient
|
||||
return event;
|
||||
}
|
||||
|
||||
public static void onClientChangeGameMode(NetworkPlayerInfo info, GameType currentGameMode, GameType newGameMode)
|
||||
{
|
||||
if (currentGameMode != newGameMode)
|
||||
{
|
||||
ClientPlayerChangeGameModeEvent evt = new ClientPlayerChangeGameModeEvent(info, currentGameMode, newGameMode);
|
||||
MinecraftForge.EVENT_BUS.post(evt);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static IBakedModel handlePerspective(IBakedModel model, ItemCameraTransforms.TransformType type, MatrixStack stack)
|
||||
{
|
||||
@@ -738,7 +751,7 @@ public class ForgeHooksClient
|
||||
IVertexBuilder ivertexbuilder;
|
||||
if (fabulous)
|
||||
{
|
||||
ivertexbuilder = ItemRenderer.func_239391_c_(bufferIn, rendertype, true, itemStackIn.hasEffect());
|
||||
ivertexbuilder = ItemRenderer.getEntityGlintVertexBuilder(bufferIn, rendertype, true, itemStackIn.hasEffect());
|
||||
} else {
|
||||
ivertexbuilder = ItemRenderer.getBuffer(bufferIn, rendertype, true, itemStackIn.hasEffect());
|
||||
}
|
||||
@@ -746,4 +759,14 @@ public class ForgeHooksClient
|
||||
}
|
||||
net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
|
||||
}
|
||||
|
||||
public static boolean isNameplateInRenderDistance(Entity entity, double squareDistance) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
final ModifiableAttributeInstance attribute = ((LivingEntity) entity).getAttribute(ForgeMod.NAMETAG_DISTANCE.get());
|
||||
if (attribute != null) {
|
||||
return !(squareDistance > (attribute.getValue() * attribute.getValue()));
|
||||
}
|
||||
}
|
||||
return !(squareDistance > 4096.0f);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 238 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user