Update to 1.14.2
This commit is contained in:
parent
d3e8804dbf
commit
a7df63e1a1
|
@ -19,7 +19,13 @@
|
|||
/mdk/build
|
||||
|
||||
#occupational hazards
|
||||
/projects/
|
||||
/projects/mcp/
|
||||
/projects/clean/
|
||||
/projects/forge/
|
||||
/projects/**/build/
|
||||
/projects/**/out/
|
||||
/projects/**/run/
|
||||
/projects/**/*.launch
|
||||
/repo/
|
||||
/buildSrc
|
||||
|
||||
|
|
|
@ -71,12 +71,7 @@ pipeline {
|
|||
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
}
|
||||
steps {
|
||||
cache(maxCacheSize: 250/*MB*/, caches: [
|
||||
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
|
||||
]){
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
//We're not testing anymore so don't use the test group
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
|
||||
}
|
||||
}
|
||||
|
@ -88,11 +83,7 @@ pipeline {
|
|||
CROWDIN = credentials('forge-crowdin')
|
||||
}
|
||||
steps {
|
||||
cache(maxCacheSize: 250/*MB*/, caches: [
|
||||
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
|
||||
]){
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
35
build.gradle
35
build.gradle
|
@ -31,7 +31,7 @@ plugins {
|
|||
id 'net.minecrell.licenser' version '0.4'
|
||||
id 'org.ajoberstar.grgit' version '2.3.0'
|
||||
id 'de.undercouch.download' version '3.3.0'
|
||||
id "com.github.ben-manes.versions" version '0.20.0'
|
||||
id 'com.github.ben-manes.versions' version '0.20.0'
|
||||
}
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
|
@ -45,13 +45,13 @@ ext {
|
|||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'snapshot'
|
||||
MAPPING_VERSION = '20180921-1.13'
|
||||
MC_VERSION = '1.13.2'
|
||||
MCP_VERSION = '20190213.203750'
|
||||
MAPPING_VERSION = '20190526-1.13.2'
|
||||
MC_VERSION = '1.14.2'
|
||||
MCP_VERSION = '20190603.175704'
|
||||
}
|
||||
|
||||
project(':mcp') {
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.mcp'
|
||||
apply plugin: 'net.minecraftforge.gradle.mcp'
|
||||
mcp {
|
||||
config = MC_VERSION + '-' + MCP_VERSION
|
||||
pipeline = 'joined'
|
||||
|
@ -61,11 +61,16 @@ project(':mcp') {
|
|||
project(':clean') {
|
||||
evaluationDependsOn(':mcp')
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.patcher'
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation 'net.minecraftforge:forgespi:0.13.+'
|
||||
}
|
||||
patcher {
|
||||
parent = project(':mcp')
|
||||
mcVersion = MC_VERSION
|
||||
|
@ -102,7 +107,7 @@ project(':forge') {
|
|||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.patcher'
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
apply plugin: 'net.minecrell.licenser'
|
||||
apply plugin: 'de.undercouch.download'
|
||||
|
||||
|
@ -133,8 +138,8 @@ project(':forge') {
|
|||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDirs = [
|
||||
"$rootDir/src/test/java",
|
||||
"$rootDir/src/fmllaunchertest/java"
|
||||
//"$rootDir/src/test/java",
|
||||
//"$rootDir/src/fmllaunchertest/java"
|
||||
]
|
||||
}
|
||||
resources {
|
||||
|
@ -161,7 +166,7 @@ project(':forge') {
|
|||
}
|
||||
|
||||
ext {
|
||||
SPEC_VERSION = '25.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
SPEC_VERSION = '26.0' // 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.
|
||||
|
@ -321,8 +326,6 @@ project(':forge') {
|
|||
fmllauncherImplementation.extendsFrom(installer)
|
||||
}
|
||||
dependencies {
|
||||
api 'net.minecraft:client:${MC_VERSION}:extra'
|
||||
installer 'com.paulscode:soundsystem:2018+'
|
||||
installer 'org.ow2.asm:asm:6.2'
|
||||
installer 'org.ow2.asm:asm-commons:6.2'
|
||||
installer 'org.ow2.asm:asm-tree:6.2'
|
||||
|
@ -345,9 +348,9 @@ project(':forge') {
|
|||
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
|
||||
fmllauncherImplementation 'com.google.guava:guava:21.0'
|
||||
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:5.0.0"
|
||||
testImplementation "org.opentest4j:opentest4j:1.0.0" // needed for junit 5
|
||||
testImplementation "org.hamcrest:hamcrest-all:1.3" // needs advanced matching for list order
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.0'
|
||||
testImplementation 'org.opentest4j:opentest4j:1.0.0' // needed for junit 5
|
||||
testImplementation 'org.hamcrest:hamcrest-all:1.3' // needs advanced matching for list order
|
||||
}
|
||||
|
||||
def extraTxts = [
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
--- a/com/mojang/blaze3d/platform/GLX.java
|
||||
+++ b/com/mojang/blaze3d/platform/GLX.java
|
||||
@@ -115,6 +115,10 @@
|
||||
p_212906_0_.put(1286, "Operation on incomplete framebuffer");
|
||||
});
|
||||
|
||||
+ /* Stores the last values sent into glMultiTexCoord2f */
|
||||
+ public static float lastBrightnessX = 0.0f;
|
||||
+ public static float lastBrightnessY = 0.0f;
|
||||
+
|
||||
public static void populateSnooperWithOpenGL(IDataHolder p_populateSnooperWithOpenGL_0_) {
|
||||
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_version", GlStateManager.getString(7938));
|
||||
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_vendor", GlStateManager.getString(7936));
|
||||
@@ -909,6 +913,10 @@
|
||||
GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_);
|
||||
}
|
||||
|
||||
+ if (p_glMultiTexCoord2f_0_ == GL_TEXTURE1) {
|
||||
+ lastBrightnessX = p_glMultiTexCoord2f_1_;
|
||||
+ lastBrightnessY = p_glMultiTexCoord2f_2_;
|
||||
+ }
|
||||
}
|
||||
|
||||
public static void glBlendFuncSeparate(int p_glBlendFuncSeparate_0_, int p_glBlendFuncSeparate_1_, int p_glBlendFuncSeparate_2_, int p_glBlendFuncSeparate_3_) {
|
|
@ -0,0 +1,14 @@
|
|||
--- a/com/mojang/blaze3d/platform/TextureUtil.java
|
||||
+++ b/com/mojang/blaze3d/platform/TextureUtil.java
|
||||
@@ -44,7 +44,10 @@
|
||||
}
|
||||
|
||||
public static void prepareImage(NativeImage.PixelFormatGLCode p_prepareImage_0_, int p_prepareImage_1_, int p_prepareImage_2_, int p_prepareImage_3_, int p_prepareImage_4_) {
|
||||
- bind(p_prepareImage_1_);
|
||||
+ synchronized (net.minecraftforge.fml.client.SplashProgress.class)
|
||||
+ {
|
||||
+ bind(p_prepareImage_1_);
|
||||
+ }
|
||||
if (p_prepareImage_2_ >= 0) {
|
||||
GlStateManager.texParameter(3553, 33085, p_prepareImage_2_);
|
||||
GlStateManager.texParameter(3553, 33082, 0);
|
|
@ -1,11 +1,11 @@
|
|||
--- a/net/minecraft/advancements/AdvancementRewards.java
|
||||
+++ b/net/minecraft/advancements/AdvancementRewards.java
|
||||
@@ -41,7 +41,7 @@
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
public void func_192113_a(EntityPlayerMP p_192113_1_) {
|
||||
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
|
||||
p_192113_1_.func_195068_e(this.field_192115_b);
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_204313_a(new BlockPos(p_192113_1_)).func_186471_a();
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_204313_a(new BlockPos(p_192113_1_)).func_186470_a(p_192113_1_).func_186469_a(p_192113_1_.func_184817_da()).func_186471_a(); // FORGE: add player & luck to LootContext
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
|
||||
boolean flag = false;
|
||||
|
||||
for(ResourceLocation resourcelocation : this.field_192116_c) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -174,6 +174,8 @@
|
||||
@@ -186,6 +186,8 @@
|
||||
}
|
||||
|
||||
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
|
||||
|
@ -9,9 +9,9 @@
|
|||
boolean flag = false;
|
||||
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
|
||||
boolean flag1 = advancementprogress.func_192105_a();
|
||||
@@ -186,6 +188,7 @@
|
||||
@@ -198,6 +200,7 @@
|
||||
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_82766_b("announceAdvancements")) {
|
||||
this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
|
||||
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
@@ -24,6 +24,8 @@
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
@@ -25,6 +25,8 @@
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
public class ItemPredicate {
|
||||
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> custom_predicates = new java.util.HashMap<>();
|
||||
|
@ -9,14 +9,14 @@
|
|||
public static final ItemPredicate field_192495_a = new ItemPredicate();
|
||||
@Nullable
|
||||
private final Tag<Item> field_200018_b;
|
||||
@@ -90,6 +92,11 @@
|
||||
@@ -93,6 +95,11 @@
|
||||
public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) {
|
||||
if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) {
|
||||
JsonObject jsonobject = JsonUtils.func_151210_l(p_192492_0_, "item");
|
||||
JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item");
|
||||
+ if (jsonobject.has("type")) {
|
||||
+ final ResourceLocation rl = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "type"));
|
||||
+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject);
|
||||
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
|
||||
+ final ResourceLocation rl = new ResourceLocation(JSONUtils.func_151200_h(jsonobject, "type"));
|
||||
+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject);
|
||||
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
|
||||
+ }
|
||||
MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count"));
|
||||
MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability"));
|
||||
|
@ -30,7 +30,7 @@
|
|||
+ }
|
||||
+
|
||||
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
|
||||
+ return unmod_predicates;
|
||||
+ return unmod_predicates;
|
||||
+ }
|
||||
+
|
||||
public static class Builder {
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
--- a/net/minecraft/block/AbstractRailBlock.java
|
||||
+++ b/net/minecraft/block/AbstractRailBlock.java
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
|
||||
- RailShape railshape = p_220053_1_.func_177230_c() == this ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
|
||||
+ RailShape railshape = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
|
||||
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
|
||||
if (!p_220069_2_.field_72995_K) {
|
||||
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
|
||||
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
|
||||
boolean flag = false;
|
||||
BlockPos blockpos = p_220069_3_.func_177977_b();
|
||||
if (!func_220064_c(p_220069_2_, blockpos)) {
|
||||
@@ -115,7 +115,7 @@
|
||||
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
|
||||
if (!p_196243_5_) {
|
||||
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
|
||||
- if (p_196243_1_.func_177229_b(this.func_176560_l()).func_208092_c()) {
|
||||
+ if (getRailDirection(p_196243_1_, p_196243_2_, p_196243_3_, null).func_208092_c()) {
|
||||
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
|
||||
}
|
||||
|
||||
@@ -127,5 +127,66 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
|
||||
public abstract IProperty<RailShape> func_176560_l();
|
||||
+
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
|
||||
+ {
|
||||
+ return !this.field_196277_c;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's direction.
|
||||
+ * Can be used to make the cart think the rail is a different shape,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @param state The BlockState
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @return The direction.
|
||||
+ */
|
||||
+ public RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @javax.annotation.Nullable net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
|
||||
+ return state.func_177229_b(func_176560_l());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param pos Block's position in world
|
||||
+ */
|
||||
+ public void onMinecartPass(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) { }
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
--- a/net/minecraft/block/BedBlock.java
|
||||
+++ b/net/minecraft/block/BedBlock.java
|
||||
@@ -85,7 +85,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_220051_2_.field_73011_w.func_76567_e() && p_220051_2_.func_180494_b(p_220051_3_) != Biomes.field_76778_j) {
|
||||
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_220051_2_.field_73011_w.canSleepAt(p_220051_4_, p_220051_3_);
|
||||
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
|
||||
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
|
||||
if (p_220051_1_.func_177229_b(field_176471_b)) {
|
||||
p_220051_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true);
|
||||
return true;
|
|
@ -1,28 +1,28 @@
|
|||
--- a/net/minecraft/block/Block.java
|
||||
+++ b/net/minecraft/block/Block.java
|
||||
@@ -75,9 +75,10 @@
|
||||
@@ -74,9 +74,10 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
-public class Block implements IItemProvider {
|
||||
+public class Block extends net.minecraftforge.registries.ForgeRegistryEntry<Block> implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock {
|
||||
protected static final Logger field_196273_d = LogManager.getLogger();
|
||||
- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap<>();
|
||||
- public static final ObjectIntIdentityMap<BlockState> field_176229_d = new ObjectIntIdentityMap<>();
|
||||
+ @Deprecated //Forge: Do not use, use GameRegistry
|
||||
+ public static final ObjectIntIdentityMap<IBlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
|
||||
private static final EnumFacing[] field_212556_a = new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.DOWN, EnumFacing.UP};
|
||||
protected final int field_149784_t;
|
||||
protected final float field_149782_v;
|
||||
@@ -298,7 +299,7 @@
|
||||
+ public static final ObjectIntIdentityMap<BlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
|
||||
private static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
|
||||
private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() {
|
||||
public Boolean load(VoxelShape p_load_1_) {
|
||||
@@ -290,7 +291,7 @@
|
||||
|
||||
@Deprecated
|
||||
public boolean func_196253_a(IBlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
|
||||
- return this.field_149764_J.func_76222_j() && p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j();
|
||||
+ return p_196253_1_.func_185904_a().func_76222_j() && p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j();
|
||||
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
|
||||
- return this.field_149764_J.func_76222_j() && (p_196253_2_.func_195996_i().func_190926_b() || p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j());
|
||||
+ return p_196253_1_.func_185904_a().func_76222_j() && (p_196253_2_.func_195996_i().func_190926_b() || p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -310,8 +311,9 @@
|
||||
@@ -302,8 +303,9 @@
|
||||
return this.field_149789_z;
|
||||
}
|
||||
|
||||
|
@ -33,39 +33,28 @@
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -322,11 +324,11 @@
|
||||
@@ -314,7 +316,7 @@
|
||||
@Deprecated
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public int func_185484_c(IBlockState p_185484_1_, IWorldReader p_185484_2_, BlockPos p_185484_3_) {
|
||||
- int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
|
||||
+ int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
|
||||
if (i == 0 && p_185484_1_.func_177230_c() instanceof BlockSlab) {
|
||||
p_185484_3_ = p_185484_3_.func_177977_b();
|
||||
p_185484_1_ = p_185484_2_.func_180495_p(p_185484_3_);
|
||||
- return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
|
||||
+ return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
|
||||
} else {
|
||||
return i;
|
||||
}
|
||||
@@ -468,8 +470,17 @@
|
||||
public int func_220058_a(BlockState p_220058_1_, IEnviromentBlockReader p_220058_2_, BlockPos p_220058_3_) {
|
||||
- return p_220058_2_.func_217338_b(p_220058_3_, p_220058_1_.func_185906_d());
|
||||
+ return p_220058_2_.func_217338_b(p_220058_3_, p_220058_1_.getLightValue(p_220058_2_, p_220058_3_));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -459,10 +461,9 @@
|
||||
|
||||
@Deprecated
|
||||
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
|
||||
+ // FORGE: Remove modded TEs when the block changes
|
||||
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer // Vanilla ITEP classes, they do this themselves
|
||||
+ || this instanceof net.minecraft.block.BlockBed
|
||||
+ || this instanceof net.minecraft.block.BlockRedstoneDiode)) {
|
||||
+ if (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
+ p_196243_2_.func_175713_t(p_196243_3_);
|
||||
+ }
|
||||
+ }
|
||||
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
|
||||
- if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
+ if (p_196243_1_.hasTileEntity() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
p_196243_2_.func_175713_t(p_196243_3_);
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use fortune/location sensitive version
|
||||
public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) {
|
||||
return 1;
|
||||
}
|
||||
@@ -484,30 +495,30 @@
|
||||
@Deprecated
|
||||
@@ -471,8 +472,8 @@
|
||||
if (f == -1.0F) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
|
@ -76,41 +65,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
- int i = this.func_196251_a(p_196255_1_, p_196255_5_, p_196255_2_, p_196255_3_, p_196255_2_.field_73012_v);
|
||||
-
|
||||
- for(int j = 0; j < i; ++j) {
|
||||
- if (!(p_196255_4_ < 1.0F) || !(p_196255_2_.field_73012_v.nextFloat() > p_196255_4_)) {
|
||||
- Item item = this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_).func_199767_j();
|
||||
- if (item != Items.field_190931_a) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(item));
|
||||
- }
|
||||
- }
|
||||
+ if (!p_196255_2_.field_72995_K && !p_196255_2_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
|
||||
+ NonNullList<ItemStack> drops = NonNullList.func_191196_a();
|
||||
+ getDrops(p_196255_1_, drops, p_196255_2_, p_196255_3_, p_196255_5_);
|
||||
+ p_196255_4_ = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(drops, p_196255_2_, p_196255_3_, p_196255_1_, p_196255_5_, p_196255_4_, false, harvesters.get());
|
||||
+ for (ItemStack stack : drops) {
|
||||
+ if (p_196255_2_.field_73012_v.nextFloat() <= p_196255_4_)
|
||||
+ func_180635_a(p_196255_2_, p_196255_3_, stack);
|
||||
}
|
||||
-
|
||||
}
|
||||
@@ -552,7 +553,7 @@
|
||||
}
|
||||
|
||||
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) {
|
||||
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")) {
|
||||
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) {// do not drop items while restoring blockstates, prevents item dupe
|
||||
+ if (captureDrops.get()) {
|
||||
+ capturedDrops.get().add(p_180635_2_);
|
||||
+ return;
|
||||
+ }
|
||||
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
|
||||
float f = 0.5F;
|
||||
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
|
||||
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
|
||||
@@ -529,6 +540,7 @@
|
||||
@@ -564,7 +565,7 @@
|
||||
}
|
||||
|
||||
public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
|
||||
- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_82766_b("doTileDrops")) {
|
||||
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_82766_b("doTileDrops") && !p_180637_1_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
|
||||
while(p_180637_3_ > 0) {
|
||||
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
|
||||
p_180637_3_ -= i;
|
||||
@@ -574,6 +575,7 @@
|
||||
|
||||
}
|
||||
|
||||
|
@ -118,57 +91,39 @@
|
|||
public float func_149638_a() {
|
||||
return this.field_149781_w;
|
||||
}
|
||||
@@ -543,7 +555,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return raytraceresult;
|
||||
+ return p_180636_0_.func_177230_c().getRayTraceResult(p_180636_0_, p_180636_1_, p_180636_2_, p_180636_3_, p_180636_4_, raytraceresult);
|
||||
}
|
||||
|
||||
public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) {
|
||||
@@ -597,16 +609,22 @@
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
|
||||
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
|
||||
p_180657_2_.func_71020_j(0.005F);
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
+ NonNullList<ItemStack> items = NonNullList.func_191196_a();
|
||||
ItemStack itemstack = this.func_180643_i(p_180657_4_);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
|
||||
+ if (!itemstack.func_190926_b()) items.add(itemstack);
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
|
||||
+ items.forEach(e -> func_180635_a(p_180657_1_, p_180657_3_, e));
|
||||
} else {
|
||||
+ harvesters.set(p_180657_2_);
|
||||
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
|
||||
p_180657_4_.func_196949_c(p_180657_1_, p_180657_3_, i);
|
||||
+ harvesters.set(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+ @Deprecated //Use state sensitive version
|
||||
protected boolean func_149700_E() {
|
||||
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
|
||||
}
|
||||
@@ -663,6 +681,7 @@
|
||||
p_176216_2_.field_70181_x = 0.0D;
|
||||
@@ -676,6 +678,7 @@
|
||||
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: Use more sensitive version below: getPickBlock
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
|
||||
return new ItemStack(this);
|
||||
@@ -690,6 +693,7 @@
|
||||
return Fluids.field_204541_a.func_207188_f();
|
||||
}
|
||||
@@ -737,6 +756,7 @@
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version
|
||||
public float func_208618_m() {
|
||||
return this.field_149765_K;
|
||||
}
|
||||
@@ -710,6 +714,7 @@
|
||||
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version
|
||||
public boolean func_149659_a(Explosion p_149659_1_) {
|
||||
return true;
|
||||
}
|
||||
@@ -754,6 +759,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version {@link IForgeBlockState#getSoundType(IWorldReader, BlockPos, Entity) }
|
||||
public SoundType func_185467_w() {
|
||||
public SoundType func_220072_p(BlockState p_220072_1_) {
|
||||
return this.field_149762_H;
|
||||
}
|
||||
@@ -758,11 +778,11 @@
|
||||
@@ -779,13 +785,74 @@
|
||||
}
|
||||
|
||||
public static boolean func_196252_e(Block p_196252_0_) {
|
||||
|
@ -181,72 +136,31 @@
|
|||
+ return net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(p_196245_0_);
|
||||
}
|
||||
|
||||
public static void func_149671_p() {
|
||||
@@ -1129,7 +1149,7 @@
|
||||
func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
|
||||
func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
|
||||
func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42)));
|
||||
- func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
|
||||
+ func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true));
|
||||
func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F)));
|
||||
func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F)));
|
||||
func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F)));
|
||||
@@ -1455,6 +1475,7 @@
|
||||
func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a()));
|
||||
func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F)));
|
||||
|
||||
+ if(false) // Processed in GameData.BlockCallbacks#onBake
|
||||
for(Block block85 : IRegistry.field_212618_g) {
|
||||
for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) {
|
||||
field_176229_d.func_195867_b(iblockstate);
|
||||
@@ -1594,4 +1615,83 @@
|
||||
return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
|
||||
}
|
||||
}
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ protected Random RANDOM = new Random();
|
||||
+ protected ThreadLocal<EntityPlayer> harvesters = new ThreadLocal<>();
|
||||
+ private net.minecraftforge.common.ToolType harvestTool;
|
||||
+ private int harvestLevel;
|
||||
+ protected static ThreadLocal<Boolean> captureDrops = ThreadLocal.withInitial(() -> false);
|
||||
+ protected static ThreadLocal<NonNullList<ItemStack>> capturedDrops = ThreadLocal.withInitial(NonNullList::func_191196_a);
|
||||
+ protected NonNullList<ItemStack> captureDrops(boolean start)
|
||||
+ {
|
||||
+ if (start) {
|
||||
+ captureDrops.set(true);
|
||||
+ capturedDrops.get().clear();
|
||||
+ return NonNullList.func_191196_a();
|
||||
+ } else {
|
||||
+ captureDrops.set(false);
|
||||
+ return capturedDrops.get();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getSlipperiness(IBlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
|
||||
+ public float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
|
||||
+ return this.field_149765_K;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSilkHarvest(IBlockState state, IWorldReader world, BlockPos pos, EntityPlayer player) {
|
||||
+ return this.func_149700_E() && !state.hasTileEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.ToolType getHarvestTool(IBlockState state) {
|
||||
+ public net.minecraftforge.common.ToolType getHarvestTool(BlockState state) {
|
||||
+ return harvestTool; //TODO: RE-Evaluate
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getHarvestLevel(IBlockState state) {
|
||||
+ public int getHarvestLevel(BlockState state) {
|
||||
+ return harvestLevel; //TODO: RE-Evaluate
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSustainPlant(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing, net.minecraftforge.common.IPlantable plantable) {
|
||||
+ IBlockState plant = plantable.getPlant(world, pos.func_177972_a(facing));
|
||||
+ net.minecraftforge.common.EnumPlantType type = plantable.getPlantType(world, pos.func_177972_a(facing));
|
||||
+ public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction facing, net.minecraftforge.common.IPlantable plantable) {
|
||||
+ BlockState plant = plantable.getPlant(world, pos.func_177972_a(facing));
|
||||
+ net.minecraftforge.common.PlantType type = plantable.getPlantType(world, pos.func_177972_a(facing));
|
||||
+
|
||||
+ if (plant.func_177230_c() == Blocks.field_150434_aF)
|
||||
+ return this.getBlock() == Blocks.field_150434_aF || this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_196611_F;
|
||||
|
@ -254,16 +168,16 @@
|
|||
+ if (plant.func_177230_c() == Blocks.field_196608_cF && this == Blocks.field_196608_cF)
|
||||
+ return true;
|
||||
+
|
||||
+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_200014_a_(state, world, pos))
|
||||
+ if (plantable instanceof BushBlock && ((BushBlock)plantable).func_200014_a_(state, world, pos))
|
||||
+ return true;
|
||||
+
|
||||
+ switch (type) {
|
||||
+ case Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof BlockGlazedTerracotta;
|
||||
+ case Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof GlazedTerracottaBlock;
|
||||
+ case Nether: return this.getBlock() == Blocks.field_150425_aM;
|
||||
+ case Crop: return this.getBlock() == Blocks.field_150458_ak;
|
||||
+ case Cave: return state.func_185896_q();
|
||||
+ case Crop: return this.getBlock() == Blocks.field_150458_ak;
|
||||
+ case Cave: return Block.func_220056_d(state, world, pos, Direction.UP);
|
||||
+ case Plains: return this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150458_ak;
|
||||
+ case Water: return state.func_185904_a() == Material.field_151586_h; //&& state.getValue(BlockLiquidWrapper)
|
||||
+ case Water: return state.func_185904_a() == Material.field_151586_h; //&& state.getValue(BlockLiquidWrapper)
|
||||
+ case Beach:
|
||||
+ boolean isBeach = this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150354_m;
|
||||
+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h ||
|
||||
|
@ -282,4 +196,7 @@
|
|||
+ });
|
||||
+ }
|
||||
+ /* ========================================= FORGE END ======================================*/
|
||||
}
|
||||
+
|
||||
public static enum OffsetType {
|
||||
NONE,
|
||||
XZ,
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockAbstractBanner.java
|
||||
+++ b/net/minecraft/block/BlockAbstractBanner.java
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, this.func_185473_a(p_196255_2_, p_196255_3_, p_196255_1_));
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
}
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
|
||||
@@ -75,4 +75,10 @@
|
||||
public EnumDyeColor func_196285_M_() {
|
||||
return this.field_196286_a;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ TileEntity te = world.func_175625_s(pos);
|
||||
+ drops.add((te instanceof TileEntityBanner) ? ((TileEntityBanner)te).func_190615_l(state) : func_185473_a(world, pos, state));
|
||||
+ }
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockAbstractSkull.java
|
||||
+++ b/net/minecraft/block/BlockAbstractSkull.java
|
||||
@@ -38,6 +38,7 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
}
|
||||
|
||||
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_) {
|
||||
@@ -45,6 +46,7 @@
|
||||
TileEntitySkull.func_195486_a(p_176208_1_, p_176208_2_);
|
||||
}
|
||||
|
||||
+ this.func_196255_a(p_176208_3_, p_176208_1_, p_176208_2_, 1.0f, 0);
|
||||
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
|
||||
}
|
||||
|
||||
@@ -55,7 +57,7 @@
|
||||
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
|
||||
if (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() && !p_196243_2_.field_72995_K) {
|
||||
TileEntity tileentity = p_196243_2_.func_175625_s(p_196243_3_);
|
||||
- if (tileentity instanceof TileEntitySkull) {
|
||||
+ if (false && tileentity instanceof TileEntitySkull) { //Forge: Moved to getDrops
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
|
||||
if (tileentityskull.func_195487_d()) {
|
||||
ItemStack itemstack = this.func_185473_a(p_196243_2_, p_196243_3_, p_196243_1_);
|
||||
@@ -74,6 +76,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ TileEntity te = world.func_175625_s(pos);
|
||||
+ if (te instanceof TileEntitySkull) {
|
||||
+ TileEntitySkull skull = (TileEntitySkull)te;
|
||||
+ if (skull.func_195487_d()) {
|
||||
+ ItemStack ret = func_185473_a(world, pos, state);
|
||||
+ Block block = skull.func_195044_w().func_177230_c();
|
||||
+ if ((block == Blocks.field_196710_eS || block == Blocks.field_196709_eR) && skull.func_152108_a() != null) {
|
||||
+ NBTTagCompound nbt = new NBTTagCompound();
|
||||
+ NBTUtil.func_180708_a(nbt, skull.func_152108_a());
|
||||
+ ret.func_196082_o().func_74782_a("SkullOwner", nbt);
|
||||
+ }
|
||||
+ drops.add(ret);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public BlockSkull.ISkullType func_196292_N_() {
|
||||
return this.field_196293_a;
|
|
@ -1,13 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockBed.java
|
||||
+++ b/net/minecraft/block/BlockBed.java
|
||||
@@ -67,7 +67,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_196250_2_.field_73011_w.func_76567_e() && p_196250_2_.func_180494_b(p_196250_3_) != Biomes.field_76778_j) {
|
||||
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_196250_2_.field_73011_w.canSleepAt(p_196250_4_, p_196250_3_);
|
||||
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
|
||||
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
|
||||
if (p_196250_1_.func_177229_b(field_176471_b)) {
|
||||
EntityPlayer entityplayer = this.func_176470_e(p_196250_2_, p_196250_3_);
|
||||
if (entityplayer != null) {
|
|
@ -1,32 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockBush.java
|
||||
+++ b/net/minecraft/block/BlockBush.java
|
||||
@@ -10,7 +10,7 @@
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReaderBase;
|
||||
|
||||
-public class BlockBush extends Block {
|
||||
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable {
|
||||
protected BlockBush(Block.Properties p_i48437_1_) {
|
||||
super(p_i48437_1_);
|
||||
}
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
BlockPos blockpos = p_196260_3_.func_177977_b();
|
||||
+ if (p_196260_1_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
+ return p_196260_2_.func_180495_p(blockpos).canSustainPlant(p_196260_2_, blockpos, EnumFacing.UP, this);
|
||||
return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos);
|
||||
}
|
||||
|
||||
@@ -44,4 +46,11 @@
|
||||
public int func_200011_d(IBlockState p_200011_1_, IBlockReader p_200011_2_, BlockPos p_200011_3_) {
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() != this) return func_176223_P();
|
||||
+ return state;
|
||||
+ }
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockChorusFlower.java
|
||||
+++ b/net/minecraft/block/BlockChorusFlower.java
|
||||
@@ -42,7 +42,7 @@
|
||||
BlockPos blockpos = p_196267_3_.func_177984_a();
|
||||
if (p_196267_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) {
|
||||
int i = p_196267_1_.func_177229_b(field_185607_a);
|
||||
- if (i < 5) {
|
||||
+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, true)) {
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
IBlockState iblockstate = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b());
|
||||
@@ -99,7 +99,7 @@
|
||||
} else {
|
||||
this.func_185605_c(p_196267_2_, p_196267_3_);
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockCocoa.java
|
||||
+++ b/net/minecraft/block/BlockCocoa.java
|
||||
@@ -34,10 +34,11 @@
|
||||
}
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
- if (p_196267_2_.field_73012_v.nextInt(5) == 0) {
|
||||
+ if (true) {
|
||||
int i = p_196267_1_.func_177229_b(field_176501_a);
|
||||
- if (i < 2) {
|
||||
+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_2_.field_73012_v.nextInt(5) == 0)) {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,14 +91,20 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- int i = p_196255_1_.func_177229_b(field_176501_a);
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ super.getDrops(state, drops, world, pos, fortune);
|
||||
+ int i = state.func_177229_b(field_176501_a);
|
||||
int j = 1;
|
||||
if (i >= 2) {
|
||||
j = 3;
|
||||
}
|
||||
|
||||
for(int k = 0; k < j; ++k) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_196130_bo));
|
||||
+ drops.add(new ItemStack(Items.field_196130_bo));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockCrops.java
|
||||
+++ b/net/minecraft/block/BlockCrops.java
|
||||
@@ -55,12 +55,14 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
|
||||
if (p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9) {
|
||||
int i = this.func_185527_x(p_196267_1_);
|
||||
if (i < this.func_185526_g()) {
|
||||
float f = func_180672_a(this, p_196267_2_, p_196267_3_);
|
||||
- if (p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0) {
|
||||
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0)) {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, this.func_185528_e(i + 1), 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,9 +91,9 @@
|
||||
for(int j = -1; j <= 1; ++j) {
|
||||
float f1 = 0.0F;
|
||||
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
|
||||
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak) {
|
||||
+ if (iblockstate.canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) {
|
||||
f1 = 1.0F;
|
||||
- if (iblockstate.func_177229_b(BlockFarmland.field_176531_a) > 0) {
|
||||
+ if (iblockstate.isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) {
|
||||
f1 = 3.0F;
|
||||
}
|
||||
}
|
||||
@@ -135,15 +137,20 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, 0);
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
- int i = this.func_185527_x(p_196255_1_);
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ super.getDrops(state, drops, world, pos, 0);
|
||||
+ {
|
||||
+ int i = this.func_185527_x(state);
|
||||
if (i >= this.func_185526_g()) {
|
||||
- int j = 3 + p_196255_5_;
|
||||
+ int j = 3 + fortune;
|
||||
|
||||
for(int k = 0; k < j; ++k) {
|
||||
- if (p_196255_2_.field_73012_v.nextInt(2 * this.func_185526_g()) <= i) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(this.func_199772_f()));
|
||||
+ if (world.field_73012_v.nextInt(2 * this.func_185526_g()) <= i) {
|
||||
+ drops.add(new ItemStack(this.func_199772_f()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockDeadBush.java
|
||||
+++ b/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -14,7 +14,7 @@
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush {
|
||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable {
|
||||
protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
|
||||
|
||||
protected BlockDeadBush(Block.Properties p_i48418_1_) {
|
||||
@@ -46,4 +46,10 @@
|
||||
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, flag ? Blocks.field_150350_a.func_176223_P() : p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_196555_aI));
|
||||
+ }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockDirtSnowySpreadable.java
|
||||
+++ b/net/minecraft/block/BlockDirtSnowySpreadable.java
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
if (!p_196267_2_.field_72995_K) {
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
|
||||
if (!func_196383_a(p_196267_2_, p_196267_3_)) {
|
||||
p_196267_2_.func_175656_a(p_196267_3_, Blocks.field_150346_d.func_176223_P());
|
||||
} else {
|
|
@ -1,19 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockDoublePlant.java
|
||||
+++ b/net/minecraft/block/BlockDoublePlant.java
|
||||
@@ -43,7 +43,7 @@
|
||||
@Nullable
|
||||
public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) {
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
- return blockpos.func_177956_o() < 255 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null;
|
||||
+ return blockpos.func_177956_o() < p_196258_1_.func_195991_k().func_72800_K() - 1 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null;
|
||||
}
|
||||
|
||||
public void func_180633_a(World p_180633_1_, BlockPos p_180633_2_, IBlockState p_180633_3_, EntityLivingBase p_180633_4_, ItemStack p_180633_5_) {
|
||||
@@ -51,6 +51,7 @@
|
||||
}
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
+ if (p_196260_1_.func_177230_c() != this) return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
if (p_196260_1_.func_177229_b(field_176492_b) != DoubleBlockHalf.UPPER) {
|
||||
return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_);
|
||||
} else {
|
|
@ -1,11 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockDropper.java
|
||||
+++ b/net/minecraft/block/BlockDropper.java
|
||||
@@ -37,7 +37,7 @@
|
||||
p_176439_1_.func_175718_b(1001, p_176439_2_, 0);
|
||||
} else {
|
||||
ItemStack itemstack = tileentitydispenser.func_70301_a(i);
|
||||
- if (!itemstack.func_190926_b()) {
|
||||
+ if (!itemstack.func_190926_b() && net.minecraftforge.items.VanillaInventoryCodeHooks.dropperInsertHook(p_176439_1_, p_176439_2_, tileentitydispenser, i, itemstack)) {
|
||||
EnumFacing enumfacing = p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
|
||||
IInventory iinventory = TileEntityHopper.func_195484_a(p_176439_1_, p_176439_2_.func_177972_a(enumfacing));
|
||||
ItemStack itemstack1;
|
|
@ -1,21 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockEnderChest.java
|
||||
+++ b/net/minecraft/block/BlockEnderChest.java
|
||||
@@ -81,7 +81,7 @@
|
||||
InventoryEnderChest inventoryenderchest = p_196250_4_.func_71005_bN();
|
||||
TileEntity tileentity = p_196250_2_.func_175625_s(p_196250_3_);
|
||||
if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest) {
|
||||
- if (p_196250_2_.func_180495_p(p_196250_3_.func_177984_a()).func_185915_l()) {
|
||||
+ if (p_196250_2_.func_180495_p(p_196250_3_.func_177984_a()).doesSideBlockChestOpening(p_196250_2_, p_196250_3_.func_177984_a(), EnumFacing.DOWN)) {
|
||||
return true;
|
||||
} else if (p_196250_2_.field_72995_K) {
|
||||
return true;
|
||||
@@ -173,4 +173,9 @@
|
||||
public boolean func_196266_a(IBlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSilkHarvest(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, EntityPlayer player) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockFalling.java
|
||||
+++ b/net/minecraft/block/BlockFalling.java
|
||||
@@ -48,7 +48,9 @@
|
||||
p_176503_1_.func_72838_d(entityfallingblock);
|
||||
}
|
||||
} else {
|
||||
+ IBlockState state = func_176223_P();
|
||||
if (p_176503_1_.func_180495_p(p_176503_2_).func_177230_c() == this) {
|
||||
+ state = p_176503_1_.func_180495_p(p_176503_2_);
|
||||
p_176503_1_.func_175698_g(p_176503_2_);
|
||||
}
|
||||
|
||||
@@ -58,7 +60,7 @@
|
||||
}
|
||||
|
||||
if (blockpos.func_177956_o() > 0) {
|
||||
- p_176503_1_.func_175656_a(blockpos.func_177984_a(), this.func_176223_P());
|
||||
+ p_176503_1_.func_175656_a(blockpos.func_177984_a(), state); //Forge: Fix loss of state information during world gen.
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockFence.java
|
||||
+++ b/net/minecraft/block/BlockFence.java
|
||||
@@ -64,15 +64,12 @@
|
||||
IBlockReader iblockreader = p_196258_1_.func_195991_k();
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
|
||||
- BlockPos blockpos1 = blockpos.func_177978_c();
|
||||
- BlockPos blockpos2 = blockpos.func_177974_f();
|
||||
- BlockPos blockpos3 = blockpos.func_177968_d();
|
||||
- BlockPos blockpos4 = blockpos.func_177976_e();
|
||||
- IBlockState iblockstate = iblockreader.func_180495_p(blockpos1);
|
||||
- IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2);
|
||||
- IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3);
|
||||
- IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4);
|
||||
- return super.func_196258_a(p_196258_1_).func_206870_a(field_196409_a, Boolean.valueOf(this.func_196416_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196416_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.WEST)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196416_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196416_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.EAST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
+ return super.func_196258_a(p_196258_1_)
|
||||
+ .func_206870_a(field_196409_a, canFenceConnectTo(iblockreader, blockpos, EnumFacing.NORTH))
|
||||
+ .func_206870_a(field_196411_b, canFenceConnectTo(iblockreader, blockpos, EnumFacing.EAST))
|
||||
+ .func_206870_a(field_196413_c, canFenceConnectTo(iblockreader, blockpos, EnumFacing.SOUTH))
|
||||
+ .func_206870_a(field_196414_y, canFenceConnectTo(iblockreader, blockpos, EnumFacing.WEST))
|
||||
+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
}
|
||||
|
||||
public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) {
|
||||
@@ -80,7 +77,7 @@
|
||||
p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_));
|
||||
}
|
||||
|
||||
- return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196416_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
+ return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canFenceConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
}
|
||||
|
||||
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
|
||||
@@ -90,4 +87,16 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
|
||||
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
|
||||
+ return func_196416_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
|
||||
+ }
|
||||
+
|
||||
+ private boolean canFenceConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ BlockPos offset = pos.func_177972_a(facing);
|
||||
+ IBlockState other = world.func_180495_p(offset);
|
||||
+ return other.canBeConnectedTo(world, offset, facing.func_176734_d()) || func_176223_P().canBeConnectedTo(world, pos, facing);
|
||||
+ }
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockFenceGate.java
|
||||
+++ b/net/minecraft/block/BlockFenceGate.java
|
||||
@@ -100,7 +100,7 @@
|
||||
}
|
||||
|
||||
private boolean func_196380_i(IBlockState p_196380_1_) {
|
||||
- return p_196380_1_.func_177230_c() == Blocks.field_150463_bK || p_196380_1_.func_177230_c() == Blocks.field_196723_eg;
|
||||
+ return p_196380_1_.func_177230_c() == Blocks.field_150463_bK || p_196380_1_.func_177230_c() == Blocks.field_196723_eg || p_196380_1_.func_177230_c() instanceof BlockWall;
|
||||
}
|
||||
|
||||
public boolean func_196250_a(IBlockState p_196250_1_, World p_196250_2_, BlockPos p_196250_3_, EntityPlayer p_196250_4_, EnumHand p_196250_5_, EnumFacing p_196250_6_, float p_196250_7_, float p_196250_8_, float p_196250_9_) {
|
||||
@@ -145,4 +145,14 @@
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ if (state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE) {
|
||||
+ Block other = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return other instanceof BlockFence || other instanceof BlockWall;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockIce.java
|
||||
+++ b/net/minecraft/block/BlockIce.java
|
||||
@@ -34,8 +34,10 @@
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
|
||||
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
|
||||
p_180657_2_.func_71020_j(0.005F);
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
|
||||
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
+ net.minecraft.util.NonNullList<ItemStack> items = net.minecraft.util.NonNullList.func_193580_a(ItemStack.field_190927_a, func_180643_i(p_180657_4_));
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
|
||||
+ items.stream().filter(e -> !e.func_190926_b()).forEach(e -> func_180635_a(p_180657_1_, p_180657_3_, e));
|
||||
} else {
|
||||
if (p_180657_1_.field_73011_w.func_177500_n()) {
|
||||
p_180657_1_.func_175698_g(p_180657_3_);
|
||||
@@ -43,7 +45,9 @@
|
||||
}
|
||||
|
||||
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
|
||||
+ harvesters.set(p_180657_2_);
|
||||
p_180657_4_.func_196949_c(p_180657_1_, p_180657_3_, i);
|
||||
+ harvesters.set(null);
|
||||
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a();
|
||||
if (material.func_76230_c() || material.func_76224_d()) {
|
||||
p_180657_1_.func_175656_a(p_180657_3_, Blocks.field_150355_j.func_176223_P());
|
|
@ -1,12 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockLadder.java
|
||||
+++ b/net/minecraft/block/BlockLadder.java
|
||||
@@ -151,4 +151,9 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockLeaves.java
|
||||
+++ b/net/minecraft/block/BlockLeaves.java
|
||||
@@ -26,7 +26,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class BlockLeaves extends Block {
|
||||
+public class BlockLeaves extends Block implements net.minecraftforge.common.IShearable {
|
||||
public static final IntegerProperty field_208494_a = BlockStateProperties.field_208514_aa;
|
||||
public static final BooleanProperty field_208495_b = BlockStateProperties.field_208515_s;
|
||||
protected static boolean field_196478_c;
|
||||
@@ -122,28 +122,37 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
- int i = this.func_196472_i(p_196255_1_);
|
||||
- if (p_196255_5_ > 0) {
|
||||
- i -= 2 << p_196255_5_;
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World worldIn, BlockPos pos, int fortune) {
|
||||
+ {
|
||||
+ int i = this.func_196472_i(state);
|
||||
+ if (fortune > 0) {
|
||||
+ i -= 2 << fortune;
|
||||
if (i < 10) {
|
||||
i = 10;
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_196255_2_.field_73012_v.nextInt(i) == 0) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_)));
|
||||
+ if (worldIn.field_73012_v.nextInt(i) == 0) {
|
||||
+ ItemStack drop = new ItemStack(this.func_199769_a(state, worldIn, pos, fortune));
|
||||
+ if (!drop.func_190926_b())
|
||||
+ drops.add(drop);
|
||||
}
|
||||
|
||||
i = 200;
|
||||
- if (p_196255_5_ > 0) {
|
||||
- i -= 10 << p_196255_5_;
|
||||
+ if (fortune > 0) {
|
||||
+ i -= 10 << fortune;
|
||||
if (i < 40) {
|
||||
i = 40;
|
||||
}
|
||||
}
|
||||
|
||||
- this.func_196474_a(p_196255_2_, p_196255_3_, p_196255_1_, i);
|
||||
+ captureDrops(true);
|
||||
+ this.func_196474_a(worldIn, pos, state, i);
|
||||
+ drops.addAll(captureDrops(false));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,13 +182,7 @@
|
||||
}
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ) {
|
||||
- p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
|
||||
- p_180657_2_.func_71020_j(0.005F);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(this));
|
||||
- } else {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
- }
|
||||
}
|
||||
|
||||
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
|
||||
@@ -189,4 +192,10 @@
|
||||
public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) {
|
||||
return func_208493_b(this.func_176223_P().func_206870_a(field_208495_b, Boolean.valueOf(true)), p_196258_1_.func_195991_k(), p_196258_1_.func_195995_a());
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(@javax.annotation.Nonnull ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(this));
|
||||
+ }
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ b/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -13,6 +13,8 @@
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMobSpawner extends BlockContainer {
|
||||
+ private static final java.util.Random RAND = new java.util.Random();
|
||||
+
|
||||
protected BlockMobSpawner(Block.Properties p_i48364_1_) {
|
||||
super(p_i48364_1_);
|
||||
}
|
||||
@@ -27,10 +29,13 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- int i = 15 + p_196255_2_.field_73012_v.nextInt(15) + p_196255_2_.field_73012_v.nextInt(15);
|
||||
- this.func_180637_b(p_196255_2_, p_196255_3_, i);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune) {
|
||||
+ return 15 + RAND.nextInt(15) + RAND.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public EnumBlockRenderType func_149645_b(IBlockState p_149645_1_) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockMushroom.java
|
||||
+++ b/net/minecraft/block/BlockMushroom.java
|
||||
@@ -64,7 +64,7 @@
|
||||
IBlockState iblockstate = p_196260_2_.func_180495_p(blockpos);
|
||||
Block block = iblockstate.func_177230_c();
|
||||
if (block != Blocks.field_150391_bh && block != Blocks.field_196661_l) {
|
||||
- return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && this.func_200014_a_(iblockstate, p_196260_2_, blockpos);
|
||||
+ return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && iblockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.EnumFacing.UP, this);
|
||||
} else {
|
||||
return true;
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockNetherWart.java
|
||||
+++ b/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -33,16 +33,22 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
int i = p_196267_1_.func_177229_b(field_176486_a);
|
||||
- if (i < 3 && p_196267_4_.nextInt(10) == 0) {
|
||||
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt(10) == 0)) {
|
||||
p_196267_1_ = p_196267_1_.func_206870_a(field_176486_a, Integer.valueOf(i + 1));
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
|
||||
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState p_196255_1_, net.minecraft.util.NonNullList<ItemStack> drops, World p_196255_2_, BlockPos p_196255_3_, int p_196255_5_) {
|
||||
+ {
|
||||
int i = 1;
|
||||
if (p_196255_1_.func_177229_b(field_176486_a) >= 3) {
|
||||
i = 2 + p_196255_2_.field_73012_v.nextInt(3);
|
||||
@@ -52,7 +58,7 @@
|
||||
}
|
||||
|
||||
for(int j = 0; j < i; ++j) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_151075_bm));
|
||||
+ drops.add(new ItemStack(Items.field_151075_bm));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockOre.java
|
||||
+++ b/net/minecraft/block/BlockOre.java
|
||||
@@ -49,23 +49,27 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- if (this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune) {
|
||||
+ World world = reader instanceof World ? (World)reader : null;
|
||||
+ if (world == null || this.func_199769_a(state, world, pos, fortune) != this) {
|
||||
int i = 0;
|
||||
if (this == Blocks.field_150365_q) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 0, 2);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 0, 2);
|
||||
} else if (this == Blocks.field_150482_ag) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 3, 7);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 3, 7);
|
||||
} else if (this == Blocks.field_150412_bA) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 3, 7);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 3, 7);
|
||||
} else if (this == Blocks.field_150369_x) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 2, 5);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 2, 5);
|
||||
} else if (this == Blocks.field_196766_fg) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 2, 5);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 2, 5);
|
||||
}
|
||||
-
|
||||
- this.func_180637_b(p_196255_2_, p_196255_3_, i);
|
||||
+ return i;
|
||||
}
|
||||
-
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
|
|
@ -1,50 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockPane.java
|
||||
+++ b/net/minecraft/block/BlockPane.java
|
||||
@@ -25,15 +25,12 @@
|
||||
IBlockReader iblockreader = p_196258_1_.func_195991_k();
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
|
||||
- BlockPos blockpos1 = blockpos.func_177978_c();
|
||||
- BlockPos blockpos2 = blockpos.func_177968_d();
|
||||
- BlockPos blockpos3 = blockpos.func_177976_e();
|
||||
- BlockPos blockpos4 = blockpos.func_177974_f();
|
||||
- IBlockState iblockstate = iblockreader.func_180495_p(blockpos1);
|
||||
- IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2);
|
||||
- IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3);
|
||||
- IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4);
|
||||
- return this.func_176223_P().func_206870_a(field_196409_a, Boolean.valueOf(this.func_196417_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196417_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196417_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.EAST)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196417_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.WEST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
+ return this.func_176223_P()
|
||||
+ .func_206870_a(field_196409_a, canPaneConnectTo(iblockreader, blockpos, EnumFacing.NORTH))
|
||||
+ .func_206870_a(field_196413_c, canPaneConnectTo(iblockreader, blockpos, EnumFacing.SOUTH))
|
||||
+ .func_206870_a(field_196414_y, canPaneConnectTo(iblockreader, blockpos, EnumFacing.WEST))
|
||||
+ .func_206870_a(field_196411_b, canPaneConnectTo(iblockreader, blockpos, EnumFacing.EAST))
|
||||
+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
}
|
||||
|
||||
public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) {
|
||||
@@ -41,7 +38,7 @@
|
||||
p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_));
|
||||
}
|
||||
|
||||
- return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196417_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
+ return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canPaneConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
}
|
||||
|
||||
public boolean func_149686_d(IBlockState p_149686_1_) {
|
||||
@@ -87,4 +84,16 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
|
||||
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THIN : BlockFaceShape.CENTER_SMALL;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
|
||||
+ return func_196417_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
|
||||
+ }
|
||||
+
|
||||
+ private boolean canPaneConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ BlockPos offset = pos.func_177972_a(facing);
|
||||
+ IBlockState other = world.func_180495_p(offset);
|
||||
+ return other.canBeConnectedTo(world, offset, facing.func_176734_d()) || func_176223_P().canBeConnectedTo(world, pos, facing);
|
||||
+ }
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
--- a/net/minecraft/block/BlockPistonBase.java
|
||||
+++ b/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -244,7 +244,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !block.func_149716_u();
|
||||
+ return !p_185646_0_.hasTileEntity();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -280,7 +280,9 @@
|
||||
for(int j = list2.size() - 1; j >= 0; --j) {
|
||||
BlockPos blockpos2 = list2.get(j);
|
||||
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos2);
|
||||
- iblockstate.func_196949_c(p_176319_1_, blockpos2, 0);
|
||||
+ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
|
||||
+ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f;
|
||||
+ iblockstate.func_196941_a(p_176319_1_, blockpos2, chance, 0);
|
||||
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
|
||||
--k;
|
||||
aiblockstate[k] = iblockstate;
|
||||
@@ -333,6 +335,10 @@
|
||||
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
|
||||
}
|
||||
|
||||
+ public IBlockState rotate(IBlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) {
|
||||
+ return state.func_177229_b(field_176320_b) ? state : super.rotate(state, world, pos, direction);
|
||||
+ }
|
||||
+
|
||||
public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
|
||||