Compare commits

..
64 Commits
Author SHA1 Message Date
LexManos ff0bb8c83c Initial 1.14.3 update. 2019-06-24 19:01:03 -07:00
cpw e5acea60e6 Fix too many registries being sent from server to client
Signed-off-by: cpw <[email protected]>
2019-06-23 19:54:55 -04:00
tterrag 216b536967 Remove OnlyIn on TagCollection#getOwningTags
Fixes Block#getTags crashing on servers
2019-06-23 18:36:27 -04:00
cpw 0a819da0e7 Reorganize sided event dispatch slightly. Dispatch model and entityrenderer
functions at more appropriate times.

Signed-off-by: cpw <[email protected]>
2019-06-23 16:01:20 -04:00
cpw bdad2af27b Tweak for lowercase handling.
Signed-off-by: cpw <[email protected]>
2019-06-23 14:51:58 -04:00
cpw 60513446fa Merge branch 'pull/5793' into 1.14.x 2019-06-23 14:42:32 -04:00
cpw be415091cd Fix crash when crashing during modloading. Fix GuiModList being weird.
Signed-off-by: cpw <[email protected]>
2019-06-23 14:37:05 -04:00
cpw 9067dbf6a0 Process the main modloading work on the async thread, but still
do deferred work on the main thread by passing in the executor.

Signed-off-by: cpw <[email protected]>
2019-06-23 12:26:45 -04:00
tterrag 359be1a880 Clean up config comments, make comment array nonnull 2019-06-23 02:57:00 -04:00
tterrag 99624bf3b5 Fix forge event bus never starting up 2019-06-23 02:17:51 -04:00
tterrag 252b94a110 Automatically add range to config comments 2019-06-23 02:17:28 -04:00
cpw 448d996a45 First pass of adding text to the loading progress UI. It deliberately uses the very primitive STB
generated font, so can only render basic ASCII text, and also only renders pre-defined strings,
as translations aren't available either.

Signed-off-by: cpw <[email protected]>
2019-06-22 23:39:00 -04:00
JoJoDeveloping b9e5dfd286 Add mod failure identification 2019-06-23 03:14:05 +02:00
cpw d966746fbf Moved some events to the Mod's event bus. You'll need to update which bus
you're listening to for these. (The Mod event bus is the only one actively
dispatching events during model loading).

ModelRegistryEvent, ModelBakeEvent, TextureStitchEvent.Pre, TextureStitchEvent.Post, ColourHandlerEvent.Block, ColourHandlerEvent.Item

Signed-off-by: cpw <[email protected]>
2019-06-22 20:36:07 -04:00
cpw 89baeb3d5d Fix StartupQuery, and put tests back.
Signed-off-by: cpw <[email protected]>
2019-06-22 19:58:10 -04:00
cpw 89006458a2 Fix stupid bug introduced with the refactor..
Signed-off-by: cpw <[email protected]>
2019-06-22 19:08:49 -04:00
cpw 389bc1ecea Tidy up mod loading a bit more, and also crash if the [[mods]] list isn't
a list.

Signed-off-by: cpw <[email protected]>
2019-06-22 12:52:22 -04:00
cpw 1e0437208b Merge remote-tracking branch 'origin/1.14.x' into 1.14.x 2019-06-22 12:33:46 -04:00
cpw 256bd01e0c Fix server side loading, tweak mods command.
Signed-off-by: cpw <[email protected]>
2019-06-22 12:31:27 -04:00
tterrag ef7b035f02 Fix ModelDataTest 2019-06-21 23:35:08 -04:00
cpw 83a0dc2ef9 Merge remote-tracking branch 'origin/1.14.x' into 1.14.x 2019-06-21 22:42:33 -04:00
cpw c10174d50d Update mappings, move mod initialization to the async loader.
Signed-off-by: cpw <[email protected]>
2019-06-21 22:42:16 -04:00
tterrag 5a3b375147 Fix #5612 add entity to ISelectionContext 2019-06-21 21:15:56 -04:00
tterrag 656ff25ae1 Fix #5768 add access to MainWindow object in RenderGameOverlayEvent 2019-06-21 20:29:04 -04:00
tterrag 19059b054e Fix #5810 incorrect cullface on some models 2019-06-21 20:23:32 -04:00
tterrag 45bc487fc0 Fix #5686 ArmorLayer still calls deprecated getArmorResource 2019-06-21 19:48:00 -04:00
tterrag 9c74a31ca2 Fix bad patch breaking armor dyeing 2019-06-21 19:47:23 -04:00
tterrag 8c3e511538 Make sure test mods load, fix BlockstateRetextureTest 2019-06-21 19:35:32 -04:00
tterrag 5fb948fb35 Fix #5805 ModelBakeEvent does not fire 2019-06-21 19:34:58 -04:00
LexManos a14c2233e0 Fix lighting not being sent to client when large amounts of blocks change at once. Closes #5839
Remove RecipeType/VanillaRecipeTypes, as 1.14 has a vanilla system for this.
2019-06-19 18:10:02 -07:00
LexManos f01b87fac7 Fix some compile errors in test classes. 2019-06-19 18:07:58 -07:00
LexManos 40bdde2043 Fix Vanilla resources loading from classpath, instead of the extra jar. Causing issues in dev time, and Forge replacements. Closes #5824 2019-06-17 14:08:16 -07:00
LexManos 0a8a601877 Add temporary hard crash when mods error until we can load our error screen. 2019-06-16 00:48:38 -07:00
LexManos 002e29958e Make ReverseTagWrapper unmodifiable, fix error in log when mods folder doesn't exist initial scan. 2019-06-16 00:47:40 -07:00
cpw 604987a005 Skip running the datagenerator on unrequested mods.
Add a run config for the data task for modders to use

Signed-off-by: cpw <[email protected]>
2019-06-16 00:47:50 -04:00
cpw 7e3e6b1969 Remove paulscode hack. It is not needed in 1.14, since paulscode is
no longer used.

Signed-off-by: cpw <[email protected]>
2019-06-15 21:51:51 -04:00
cpw d821514372 Modify lex's data handler to use proper mod lifecycle event mechanisms
instead. New Lifecycle Event for requesting data harvesting. Mods will
be constructed, the registry will fire, and then a new Data event will
fire. Submit new data tag files to the data gatherer if you wish.
The game will shutdown after this. No other mod elements will happen.

Signed-off-by: cpw <[email protected]>
2019-06-15 21:24:45 -04:00
cpw 37a896fe1b Add params for the exception message
Signed-off-by: cpw <[email protected]>

tweak logging

Signed-off-by: cpw <[email protected]>
2019-06-15 19:47:08 -04:00
LexManos e1cdb2e558 Expose the data entry point and generate Forge's Tags using it. 2019-06-13 20:58:03 -07:00
LexManos c30b27fcfe Add reverse tag cache, to make looking up tags for items/blocks/etc.. less costly. 2019-06-12 19:28:10 -07:00
marcus8448 9542f51cd0 Update Example Mod (#5781) 2019-06-12 16:49:20 -07:00
its_meow a7b56f0975 Fix AT for EntitySpawnPlacementRegistry.register (#5799) 2019-06-12 16:17:25 -07:00
Johannes ed3dc8c7d3 Implement getValue in ClearableRegistry fixing DimensionArgument. (#5809)
Fix DimensionArgument
2019-06-12 16:16:32 -07:00
SquidDev ed6ce87c22 Fix RenderSpecificHandEvent firing with wrong hand (#5789) 2019-06-12 01:05:27 -04:00
kashike 4bd7427b70 Use dragon_immune block tag instead of manually checking blocks (#5792) 2019-06-12 01:04:13 -04:00
tterrag 0b1196db3f Fix #5806 sheep drop shears instead of wool
lol
2019-06-12 00:57:27 -04:00
tterrag b25ed7ef91 Fix incorrect method used in ShrubFeature patch 2019-06-12 00:51:45 -04:00
tterrag dc95130526 Rework AbstractTreeFeature patches to reduce impact and avoid name conflicts 2019-06-12 00:48:11 -04:00
tterrag d5ee80a70a Add IContainerFactory for reading custom container data on the client 2019-06-10 18:14:49 -04:00
LexManos 5dc944c1c3 Fix Fishing and Mineshaft Minecarts loot tables erroring. #5785
Fix Client block breaking speed not matching the server. #5790
Fix Village Siege event location, and MC-154328 preventing Sieges starting. #5800
Fix EntityJoinWorldEvent not firing on client, or some server code paths. #5786
2019-06-10 14:03:51 -07:00
tterrag da22fd40bf Adjust NetworkEvent#enqueueWork to match vanilla logic
In singleplayer our packet work could get delayed until the next tick,
breaking the expectation of packet read order. Fixes that using
NetworkHooks.openGui would result in missing inventory data on the client
2019-06-10 00:13:27 -04:00
LexManos 1434419e47 Fix gameDir argument error on dedicated server. 2019-06-09 11:19:01 -07:00
tterrag 3385e62aa7 Add forge registries for most vanilla registries
Made all registry names consistent with their vanilla counterparts
Also added a system for legacy registry names, so no data will be lost
Cleaned up formatting in GameData and ForgeRegistries
2019-06-09 04:23:39 -04:00
tterrag 40f2276e88 Add registry flag for syncing 2019-06-09 00:55:42 -04:00
tterrag 35cd89c00c Fix issues preventing test mods loading 2019-06-09 00:19:29 -04:00
tterrag 892fea3df9 Add forge registry for container types, expose ScreenManager.registerFactory 2019-06-09 00:19:17 -04:00
cpw 2d32929dc5 Don't NPE during construction of ModLoadingException..
Signed-off-by: cpw <[email protected]>
2019-06-08 14:30:15 -04:00
LexManos 728b4857c3 Fix misobfed methods due to mapping conflict. 2019-06-08 09:22:03 -07:00
cpw 9fa4641cb0 Update mappings
Signed-off-by: cpw <[email protected]>
2019-06-08 10:45:28 -04:00
tterrag fc04a65a0f Fix block activation not occurring serverside
Missing block of code from the old patch caused it to be skipped
2019-06-08 01:32:53 -04:00
tterrag a93d7d20ee Rework model patches/classes for new bake signature 2019-06-08 01:02:29 -04:00
LexManos b74b72e44c Fix NamespacedWrapper not delegating a new getter. Fixing data loading spam at world start.
Update red/yellow/green tags with new vanilla item names.
Reenabled test source directory in project and made ModelDataTest compile.
2019-06-07 19:34:16 -07:00
cpw 850c73b73f and userdev
Signed-off-by: cpw <[email protected]>
2019-06-07 17:34:25 -04:00
cpw d736e26e0c Fix realms class name
Signed-off-by: cpw <[email protected]>
2019-06-07 17:32:33 -04:00
402 changed files with 3745 additions and 2812 deletions

No files matched your search

+1
View File
@@ -28,6 +28,7 @@
/projects/**/*.launch
/repo/
/buildSrc
src/generated/resources/.cache/
#Patch rejects
/patches-/
+47 -8
View File
@@ -45,9 +45,9 @@ ext {
]
}
MAPPING_CHANNEL = 'snapshot'
MAPPING_VERSION = '20190526-1.13.2'
MC_VERSION = '1.14.2'
MCP_VERSION = '20190603.175704'
MAPPING_VERSION = '20190621-1.14.2'
MC_VERSION = '1.14.3'
MCP_VERSION = '20190624.152911'
}
project(':mcp') {
@@ -130,7 +130,10 @@ project(':forge') {
srcDirs = ["$rootDir/src/main/java"]
}
resources {
srcDirs = ["$rootDir/src/main/resources"]
srcDirs = [
"$rootDir/src/main/resources",
"$rootDir/src/generated/resources"
]
}
}
test {
@@ -138,8 +141,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 {
@@ -166,7 +169,7 @@ project(':forge') {
}
ext {
SPEC_VERSION = '26.0' // This is overwritten by git tag, but here so dev time doesnt explode
SPEC_VERSION = '27.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.
@@ -268,6 +271,29 @@ project(':forge') {
TestMods { sources sourceSets.test }
}
}
forge_data {
taskName 'forge_data'
main 'net.minecraftforge.userdev.LaunchTesting'
workingDirectory project.file('run')
environment 'target', 'fmldevdata'
environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main
source sourceSets.userdev
args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/')
}
}
}
@@ -332,7 +358,7 @@ project(':forge') {
installer 'cpw.mods:modlauncher:2.1.+'
installer 'cpw.mods:grossjava9hacks:1.1.+'
installer 'net.minecraftforge:accesstransformers:0.16.+:shadowed'
installer 'net.minecraftforge:eventbus:0.9.+:service'
installer 'net.minecraftforge:eventbus:0.10.+:service'
installer 'net.minecraftforge:forgespi:0.13.+'
installer 'net.minecraftforge:coremods:0.5.+'
installer 'net.minecraftforge:unsafe:0.2.+'
@@ -851,6 +877,19 @@ project(':forge') {
environment 'MCP_MAPPINGS', '{mcp_mappings}'
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
}
data {
main 'net.minecraftforge.userdev.LaunchTesting'
environment 'target', 'fmldevdata'
environment 'MC_VERSION', "${MC_VERSION}"
environment 'FORGE_GROUP', "${project.group}"
environment 'MCP_VERSION', "${MCP_VERSION}"
environment 'MOD_CLASSES', '{source_roots}'
environment 'MCP_MAPPINGS', '{mcp_mappings}'
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
}
}
}
@@ -1,7 +1,7 @@
package com.example.examplemod;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
+3 -3
View File
@@ -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="[25,)" #mandatory (24 is current forge version)
loaderVersion="[26,)" #mandatory (26 is current forge version)
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
@@ -42,7 +42,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="[25,)" #mandatory
versionRange="[26,)" #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
@@ -51,6 +51,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
[[dependencies.examplemod]]
modId="minecraft"
mandatory=true
versionRange="[1.13.2]"
versionRange="[1.14.2]"
ordering="NONE"
side="BOTH"
@@ -11,7 +11,7 @@
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 @@
@@ -913,6 +917,10 @@
GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -186,6 +186,8 @@
@@ -187,6 +187,8 @@
}
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
@@ -9,8 +9,8 @@
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -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")) {
@@ -199,6 +201,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/Block.java
+++ b/net/minecraft/block/Block.java
@@ -74,9 +74,10 @@
@@ -75,9 +75,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -13,7 +13,7 @@
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 @@
@@ -291,7 +292,7 @@
@Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
@@ -22,7 +22,7 @@
}
@Deprecated
@@ -302,8 +303,9 @@
@@ -303,8 +304,9 @@
return this.field_149789_z;
}
@@ -33,7 +33,7 @@
}
@Deprecated
@@ -314,7 +316,7 @@
@@ -315,7 +317,7 @@
@Deprecated
@OnlyIn(Dist.CLIENT)
public int func_220058_a(BlockState p_220058_1_, IEnviromentBlockReader p_220058_2_, BlockPos p_220058_3_) {
@@ -42,7 +42,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -459,10 +461,9 @@
@@ -460,10 +462,9 @@
@Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
@@ -54,7 +54,7 @@
}
@Deprecated
@@ -471,8 +472,8 @@
@@ -472,8 +473,8 @@
if (f == -1.0F) {
return 0.0F;
} else {
@@ -65,25 +65,25 @@
}
}
@@ -552,7 +553,7 @@
@@ -553,7 +554,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 (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !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;
@@ -564,7 +565,7 @@
@@ -565,7 +566,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
- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !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 @@
@@ -575,6 +576,7 @@
}
@@ -91,7 +91,7 @@
public float func_149638_a() {
return this.field_149781_w;
}
@@ -676,6 +678,7 @@
@@ -677,6 +679,7 @@
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D));
}
@@ -99,7 +99,7 @@
@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 @@
@@ -691,6 +694,7 @@
return Fluids.field_204541_a.func_207188_f();
}
@@ -107,7 +107,7 @@
public float func_208618_m() {
return this.field_149765_K;
}
@@ -710,6 +714,7 @@
@@ -711,6 +715,7 @@
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
}
@@ -115,7 +115,7 @@
public boolean func_149659_a(Explosion p_149659_1_) {
return true;
}
@@ -754,6 +759,7 @@
@@ -755,6 +760,7 @@
}
}
@@ -123,7 +123,7 @@
public SoundType func_220072_p(BlockState p_220072_1_) {
return this.field_149762_H;
}
@@ -779,13 +785,74 @@
@@ -780,13 +786,80 @@
}
public static boolean func_196252_e(Block p_196252_0_) {
@@ -140,6 +140,7 @@
+ protected Random RANDOM = new Random();
+ private net.minecraftforge.common.ToolType harvestTool;
+ private int harvestLevel;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Block> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, BlockTags::getGeneration, BlockTags::func_199896_a);
+
+ @Override
+ public float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
@@ -189,6 +190,11 @@
+ return false;
+ }
+
+ @Override
+ public final java.util.Set<ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ static {
+ net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> {
+ block.harvestTool = tool;
@@ -9,7 +9,7 @@
@Nullable
private BlockState.Cache field_215707_c;
private final int field_215708_d;
@@ -107,10 +107,14 @@
@@ -106,10 +106,14 @@
return this.field_215708_d;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/CropsBlock.java
+++ b/net/minecraft/block/CropsBlock.java
@@ -58,12 +58,14 @@
@@ -59,12 +59,14 @@
public void func_196267_b(BlockState 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_);
@@ -16,7 +16,7 @@
}
}
}
@@ -92,9 +94,9 @@
@@ -93,9 +95,9 @@
for(int j = -1; j <= 1; ++j) {
float f1 = 0.0F;
BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
@@ -28,3 +28,12 @@
f1 = 3.0F;
}
}
@@ -131,7 +133,7 @@
}
public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
- if (p_196262_4_ instanceof RavagerEntity && p_196262_2_.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (p_196262_4_ instanceof RavagerEntity && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_196262_2_, p_196262_4_)) {
p_196262_2_.func_175655_b(p_196262_3_, true);
}
@@ -1,15 +1,15 @@
--- a/net/minecraft/block/FarmlandBlock.java
+++ b/net/minecraft/block/FarmlandBlock.java
@@ -72,7 +72,7 @@
@@ -73,7 +73,7 @@
}
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) {
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && p_180658_3_.func_213311_cf() * p_180658_3_.func_213311_cf() * p_180658_3_.func_213302_cg() > 0.512F) {
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) && p_180658_3_.func_213311_cf() * p_180658_3_.func_213311_cf() * p_180658_3_.func_213302_cg() > 0.512F) {
+ if (!p_180658_1_.field_72995_K && net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) { // Forge: Move logic to Entity#canTrample
func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
}
@@ -83,9 +83,9 @@
@@ -84,9 +84,9 @@
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
}
@@ -22,7 +22,7 @@
}
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
@@ -95,7 +95,7 @@
@@ -96,7 +96,7 @@
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/FireBlock.java
+++ b/net/minecraft/block/FireBlock.java
@@ -63,13 +63,13 @@
@@ -64,13 +64,13 @@
public BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
BlockPos blockpos = p_196448_2_.func_177977_b();
BlockState blockstate = p_196448_1_.func_180495_p(blockpos);
@@ -16,10 +16,10 @@
}
}
@@ -90,12 +90,14 @@
@@ -91,12 +91,14 @@
public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
if (p_196267_2_.func_82736_K().func_82766_b("doFireTick")) {
if (p_196267_2_.func_82736_K().func_223586_b(GameRules.field_223598_a)) {
+ if (!p_196267_2_.isAreaLoaded(p_196267_3_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) {
p_196267_2_.func_217377_a(p_196267_3_, false);
@@ -32,7 +32,7 @@
int i = p_196267_1_.func_177229_b(field_176543_a);
if (!flag && p_196267_2_.func_72896_J() && this.func_176537_d(p_196267_2_, p_196267_3_) && p_196267_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
p_196267_2_.func_217377_a(p_196267_3_, false);
@@ -117,7 +119,7 @@
@@ -118,7 +120,7 @@
return;
}
@@ -41,7 +41,7 @@
p_196267_2_.func_217377_a(p_196267_3_, false);
return;
}
@@ -125,12 +127,12 @@
@@ -126,12 +128,12 @@
boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_);
int k = flag1 ? -50 : 0;
@@ -60,7 +60,7 @@
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for(int l = -1; l <= 1; ++l) {
@@ -168,16 +170,18 @@
@@ -169,16 +171,18 @@
return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d());
}
@@ -83,7 +83,7 @@
if (p_176536_4_.nextInt(p_176536_3_) < i) {
BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_);
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
@@ -198,7 +202,7 @@
@@ -199,7 +203,7 @@
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
for(Direction direction : Direction.values()) {
@@ -92,7 +92,7 @@
return true;
}
}
@@ -214,13 +218,14 @@
@@ -215,13 +219,14 @@
for(Direction direction : Direction.values()) {
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
@@ -108,7 +108,7 @@
public boolean func_196446_i(BlockState p_196446_1_) {
return this.func_220275_r(p_196446_1_) > 0;
}
@@ -245,8 +250,8 @@
@@ -246,8 +251,8 @@
BlockPos blockpos = p_180655_3_.func_177977_b();
BlockState blockstate = p_180655_2_.func_180495_p(blockpos);
@@ -119,7 +119,7 @@
for(int j = 0; j < 2; ++j) {
double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F;
double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -255,7 +260,7 @@
@@ -256,7 +261,7 @@
}
}
@@ -128,7 +128,7 @@
for(int k = 0; k < 2; ++k) {
double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -264,7 +269,7 @@
@@ -265,7 +270,7 @@
}
}
@@ -137,7 +137,7 @@
for(int l = 0; l < 2; ++l) {
double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -273,7 +278,7 @@
@@ -274,7 +279,7 @@
}
}
@@ -146,7 +146,7 @@
for(int i1 = 0; i1 < 2; ++i1) {
double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
@@ -282,7 +287,7 @@
@@ -283,7 +288,7 @@
}
}
@@ -155,7 +155,7 @@
for(int j1 = 0; j1 < 2; ++j1) {
double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
@@ -310,10 +315,23 @@
@@ -311,10 +316,23 @@
}
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/block/NetherPortalBlock.java
+++ b/net/minecraft/block/NetherPortalBlock.java
@@ -68,7 +68,7 @@
@@ -69,7 +69,7 @@
public boolean func_176548_d(IWorld p_176548_1_, BlockPos p_176548_2_) {
NetherPortalBlock.Size netherportalblock$size = this.func_201816_b(p_176548_1_, p_176548_2_);
@@ -1,10 +1,9 @@
--- a/net/minecraft/block/TrapDoorBlock.java
+++ b/net/minecraft/block/TrapDoorBlock.java
@@ -151,4 +151,14 @@
@@ -153,6 +153,16 @@
return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
}
+
+ @Override
+ public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) {
+ if (state.func_177229_b(field_176283_b)) {
@@ -14,4 +13,7 @@
+ }
+ return false;
+ }
}
+
public boolean func_220067_a(BlockState p_220067_1_, IBlockReader p_220067_2_, BlockPos p_220067_3_, EntityType<?> p_220067_4_) {
return false;
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/block/TurtleEggBlock.java
+++ b/net/minecraft/block/TurtleEggBlock.java
@@ -146,7 +146,7 @@
if (p_212570_2_ instanceof TurtleEntity) {
return false;
} else {
- return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? p_212570_1_.func_82736_K().func_223586_b(GameRules.field_223599_b) : true;
+ return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_) : true;
}
}
}
@@ -24,9 +24,9 @@
Screen.wrapScreenError(() -> {
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
if (p_197961_5_ == 0) {
- aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
- aboolean[0] = inestedguieventhandler.func_223281_a_(p_197961_3_, p_197961_4_, p_197961_6_);
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.func_223281_a_(p_197961_3_, p_197961_4_, p_197961_6_);
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
}
} else {
@@ -33,70 +33,34 @@
this.field_110448_aq.func_198983_a();
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
@@ -463,6 +464,7 @@
this.field_135017_as.func_135043_a(list);
this.field_71446_o = new TextureManager(this.field_110451_am);
this.field_110451_am.func_219534_a(this.field_71446_o);
+ //net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.textureManager);
this.func_213226_a();
this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
this.field_71469_aa = new SaveFormat(this.field_71412_D.toPath().resolve("saves"), this.field_71412_D.toPath().resolve("backups"), this.field_184131_U);
@@ -480,11 +482,14 @@
this.field_110451_am.func_219534_a(new GrassColorReloadListener());
this.field_110451_am.func_219534_a(new FoliageColorReloadListener());
+ try (net.minecraftforge.fml.common.progress.ProgressBar bar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Rendering Setup", 5, true)) {
+ bar.step("GL Setup");
this.field_195558_d.func_198076_a("Startup");
GlStateManager.enableTexture();
GlStateManager.shadeModel(7425);
GlStateManager.clearDepth(1.0D);
GlStateManager.enableDepthTest();
+ net.minecraftforge.fml.client.ClientModLoader.complete();
GlStateManager.depthFunc(515);
GlStateManager.enableAlphaTest();
GlStateManager.alphaFunc(516, 0.1F);
@@ -493,19 +498,24 @@
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
this.field_195558_d.func_198076_a("Post startup");
+ bar.step("Loading Texture Map");
this.field_147128_au = new AtlasTexture("textures");
this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
this.field_71446_o.func_110580_a(AtlasTexture.field_110575_b, this.field_147128_au);
this.field_71446_o.func_110577_a(AtlasTexture.field_110575_b);
this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
+ bar.step("Loading Model Manager");
this.field_175617_aL = new ModelManager(this.field_147128_au);
this.field_110451_am.func_219534_a(this.field_175617_aL);
this.field_184127_aH = BlockColors.func_186723_a();
this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
+ bar.step("Loading Item Renderer");
this.field_175621_X = new ItemRenderer(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
this.field_175616_W = new EntityRendererManager(this.field_71446_o, this.field_175621_X, this.field_110451_am);
this.field_175620_Y = new FirstPersonRenderer(this);
this.field_110451_am.func_219534_a(this.field_175621_X);
+ bar.step("Loading Entity Renderer");
+ //net.minecraftforge.fml.client.SplashProgress.pause();
this.field_71460_t = new GameRenderer(this, this.field_110451_am);
this.field_110451_am.func_219534_a(this.field_71460_t);
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
@@ -521,9 +531,13 @@
@@ -521,7 +522,7 @@
this.field_110451_am.func_219534_a(this.field_213272_aL);
this.field_213273_aM = new PotionSpriteUploader(this.field_71446_o);
this.field_110451_am.func_219534_a(this.field_213273_aM);
- this.field_71456_v = new IngameGui(this);
+ //net.minecraftforge.fml.client.SplashProgress.resume();
+ }; // Forge: end progress bar
+ net.minecraftforge.fml.client.ClientModLoader.end();
+ this.field_71456_v = new net.minecraftforge.client.ForgeIngameGui(this);
this.field_184132_p = new DebugRenderer(this);
GLX.setGlfwErrorCallback(this::func_195545_a);
+ net.minecraftforge.fml.client.ClientModLoader.complete();
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
this.field_195558_d.func_198077_g();
this.field_71474_y.field_74353_u = this.field_195558_d.func_198113_j();
@@ -646,7 +660,7 @@
@@ -542,7 +543,7 @@
if (SharedConstants.field_206244_b) {
this.func_213256_aB();
}
-
+ net.minecraftforge.fml.client.ClientModLoader.complete();
}, false));
}
@@ -557,7 +558,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_) -> {
- return ItemTags.func_199903_a().func_199913_a(p_213235_0_.func_77973_b()).stream();
+ return p_213235_0_.func_77973_b().getTags().stream();
});
NonNullList<ItemStack> nonnulllist = NonNullList.func_191196_a();
@@ -646,7 +647,7 @@
Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
if (p_71377_1_.func_71497_f() != null) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
@@ -105,7 +69,7 @@
} else if (p_71377_1_.func_147149_a(file2)) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
System.exit(-1);
@@ -661,6 +675,7 @@
@@ -661,6 +662,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -113,7 +77,7 @@
public CompletableFuture<Void> func_213237_g() {
if (this.field_213276_aV != null) {
return this.field_213276_aV;
@@ -740,16 +755,20 @@
@@ -740,16 +742,20 @@
}
public void func_147108_a(@Nullable Screen p_147108_1_) {
@@ -138,7 +102,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);
@@ -874,11 +893,13 @@
@@ -874,11 +880,13 @@
GlStateManager.enableTexture();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -152,21 +116,20 @@
}
this.field_71424_I.func_219897_b();
@@ -1146,10 +1167,10 @@
@@ -1146,10 +1154,10 @@
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();
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) {
- Direction direction = blockraytraceresult.func_216354_b();
+ Direction direction = blockraytraceresult.func_216354_b();
+ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, direction)) {
+ if (!this.field_71441_e.func_175623_d(blockpos)) {
Direction direction = blockraytraceresult.func_216354_b();
if (this.field_71442_b.func_180512_c(blockpos, direction)) {
- this.field_71452_i.func_180532_a(blockpos, direction);
+ this.field_71452_i.addBlockHitEffects(blockpos, blockraytraceresult);
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
}
}
@@ -1176,7 +1197,7 @@
@@ -1176,7 +1184,7 @@
case BLOCK:
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
BlockPos blockpos = blockraytraceresult.func_216350_a();
@@ -175,7 +138,7 @@
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
break;
}
@@ -1186,6 +1207,7 @@
@@ -1186,6 +1194,7 @@
}
this.field_71439_g.func_184821_cY();
@@ -183,7 +146,7 @@
}
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
@@ -1235,6 +1257,9 @@
@@ -1235,6 +1244,9 @@
}
}
@@ -193,7 +156,7 @@
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand) == ActionResultType.SUCCESS) {
this.field_71460_t.field_78516_c.func_187460_a(hand);
return;
@@ -1254,6 +1279,8 @@
@@ -1254,6 +1266,8 @@
--this.field_71467_ac;
}
@@ -202,7 +165,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1372,6 +1399,8 @@
@@ -1372,6 +1386,8 @@
this.field_71424_I.func_219895_b("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -211,7 +174,7 @@
}
private void func_184117_aA() {
@@ -1430,6 +1459,7 @@
@@ -1430,6 +1446,7 @@
this.field_71439_g.func_71040_bB(Screen.hasControlDown());
}
}
@@ -219,7 +182,7 @@
boolean flag2 = this.field_71474_y.field_74343_n != ChatVisibility.HIDDEN;
if (flag2) {
@@ -1526,6 +1556,12 @@
@@ -1526,6 +1543,12 @@
this.func_147108_a(worldloadprogressscreen);
while(!this.field_71437_Z.func_71200_ad()) {
@@ -232,7 +195,7 @@
worldloadprogressscreen.tick();
this.func_195542_b(false);
@@ -1546,11 +1582,17 @@
@@ -1546,11 +1569,17 @@
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_213261_0_) -> {
}));
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
@@ -251,7 +214,7 @@
WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen);
@@ -1623,6 +1665,7 @@
@@ -1623,6 +1652,7 @@
}
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
@@ -259,7 +222,7 @@
}
public final boolean func_71355_q() {
@@ -1648,112 +1691,8 @@
@@ -1648,112 +1678,8 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
@@ -374,7 +337,7 @@
}
}
@@ -1825,6 +1764,7 @@
@@ -1825,6 +1751,7 @@
return field_71432_P;
}
@@ -382,7 +345,7 @@
public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_213240_0_) -> {
return p_213240_0_;
@@ -1968,6 +1908,8 @@
@@ -1968,6 +1895,8 @@
}
public MusicTicker.MusicType func_147109_W() {
@@ -391,7 +354,7 @@
if (this.field_71462_r instanceof WinGameScreen) {
return MusicTicker.MusicType.CREDITS;
} else if (this.field_71439_g == null) {
@@ -2124,4 +2066,12 @@
@@ -2124,4 +2053,12 @@
public LoadingGui func_213250_au() {
return this.field_213279_p;
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/gui/ResourceLoadProgressGui.java
+++ b/net/minecraft/client/gui/ResourceLoadProgressGui.java
@@ -83,6 +83,7 @@
this.func_212972_a(i / 2 - 150, j / 4 * 3, i / 2 + 150, j / 4 * 3 + 10, this.field_212978_f, 1.0F - MathHelper.func_76131_a(f, 0.0F, 1.0F));
}
+ net.minecraftforge.fml.client.ClientModLoader.renderProgressText();
if (f >= 2.0F) {
this.field_212974_b.func_213268_a((LoadingGui)null);
}
@@ -0,0 +1,25 @@
--- a/net/minecraft/client/gui/ScreenManager.java
+++ b/net/minecraft/client/gui/ScreenManager.java
@@ -39,6 +39,10 @@
private static final Map<ContainerType<?>, ScreenManager.IScreenFactory<?, ?>> field_216914_b = Maps.newHashMap();
public static <T extends Container> void func_216909_a(@Nullable ContainerType<T> p_216909_0_, Minecraft p_216909_1_, int p_216909_2_, ITextComponent p_216909_3_) {
+ getScreenFactory(p_216909_0_, p_216909_1_, p_216909_2_, p_216909_3_).ifPresent(f -> f.func_216908_a(p_216909_3_, p_216909_0_, p_216909_1_, p_216909_2_));
+ }
+
+ public static <T extends Container> java.util.Optional<IScreenFactory<T, ?>> getScreenFactory(@Nullable ContainerType<T> p_216909_0_, Minecraft p_216909_1_, int p_216909_2_, ITextComponent p_216909_3_) {
if (p_216909_0_ == null) {
field_216913_a.warn("Trying to open invalid screen with name: {}", (Object)p_216909_3_.getString());
} else {
@@ -46,9 +50,10 @@
if (iscreenfactory == null) {
field_216913_a.warn("Failed to create screen for menu type: {}", (Object)Registry.field_218366_G.func_177774_c(p_216909_0_));
} else {
- iscreenfactory.func_216908_a(p_216909_3_, p_216909_0_, p_216909_1_, p_216909_2_);
+ return java.util.Optional.of(iscreenfactory);
}
}
+ return java.util.Optional.empty();
}
@Nullable
@@ -0,0 +1,28 @@
--- a/net/minecraft/client/gui/overlay/DebugOverlayGui.java
+++ b/net/minecraft/client/gui/overlay/DebugOverlayGui.java
@@ -342,7 +342,7 @@
list.add(this.func_211534_a(entry));
}
- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_199717_a().func_199913_a(blockstate.func_177230_c())) {
+ for(ResourceLocation resourcelocation : blockstate.func_177230_c().getTags()) {
list.add("#" + resourcelocation);
}
}
@@ -358,7 +358,7 @@
list.add(this.func_211534_a(entry1));
}
- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_205704_c().func_199913_a(ifluidstate.func_206886_c())) {
+ for(ResourceLocation resourcelocation1 : ifluidstate.func_206886_c().getTags()) {
list.add("#" + resourcelocation1);
}
}
@@ -368,6 +368,7 @@
list.add("");
list.add(TextFormatting.UNDERLINE + "Targeted Entity");
list.add(String.valueOf((Object)Registry.field_212629_r.func_177774_c(entity.func_200600_R())));
+ entity.func_200600_R().getTags().forEach(t -> list.add("#" + t));
}
return list;
@@ -1,14 +1,5 @@
--- a/net/minecraft/client/gui/recipebook/RecipeBookGui.java
+++ b/net/minecraft/client/gui/recipebook/RecipeBookGui.java
@@ -367,7 +367,7 @@
return true;
} else if (this.field_191888_F.field_71474_y.field_74310_D.func_197976_a(p_keyPressed_1_, p_keyPressed_2_) && !this.field_193962_q.isFocused()) {
this.field_199738_u = true;
- this.field_193962_q.func_146195_b(true);
+ this.field_193962_q.setFocused(true);
return true;
} else {
return false;
@@ -421,7 +421,7 @@
languagemanager.func_135045_a(language);
@@ -1,29 +0,0 @@
--- a/net/minecraft/client/gui/screen/AbstractCommandBlockScreen.java
+++ b/net/minecraft/client/gui/screen/AbstractCommandBlockScreen.java
@@ -86,7 +86,7 @@
this.field_195239_f.func_146180_a("-");
this.children.add(this.field_195239_f);
this.func_212928_a(this.field_195237_a);
- this.field_195237_a.func_146195_b(true);
+ this.field_195237_a.setFocused(true);
this.func_209106_o();
}
@@ -247,7 +247,7 @@
if (!list.isEmpty()) {
this.field_209111_t.addAll(list);
- this.field_209112_u = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestioncontext.startPos), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.func_146200_o() - i);
+ this.field_209112_u = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestioncontext.startPos), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.getWidth() - i);
this.field_209113_v = i;
}
@@ -290,7 +290,7 @@
i = Math.max(i, this.font.func_78256_a(suggestion.getText()));
}
- int j = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestions.getRange().getStart()), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.func_146200_o() - i);
+ int j = MathHelper.func_76125_a(this.field_195237_a.func_195611_j(suggestions.getRange().getStart()), 0, this.field_195237_a.func_195611_j(0) + this.field_195237_a.getWidth() - i);
this.field_209116_y = new AbstractCommandBlockScreen.SuggestionsList(j, 72, i, suggestions);
}
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screen/AddServerScreen.java
+++ b/net/minecraft/client/gui/screen/AddServerScreen.java
@@ -53,7 +53,7 @@
protected void init() {
this.minecraft.field_195559_v.func_197967_a(true);
this.field_146309_g = new TextFieldWidget(this.font, this.width / 2 - 100, 66, 200, 20, I18n.func_135052_a("addServer.enterName"));
- this.field_146309_g.func_146195_b(true);
+ this.field_146309_g.setFocused(true);
this.field_146309_g.func_146180_a(this.field_146311_h.field_78847_a);
this.field_146309_g.func_212954_a(this::func_213028_a);
this.children.add(this.field_146309_g);
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screen/ChatScreen.java
+++ b/net/minecraft/client/gui/screen/ChatScreen.java
@@ -351,7 +351,7 @@
public void render(int p_render_1_, int p_render_2_, float p_render_3_) {
this.setFocused(this.field_146415_a);
- this.field_146415_a.func_146195_b(true);
+ this.field_146415_a.setFocused(true);
fill(2, this.height - 14, this.width - 2, this.height - 2, this.minecraft.field_71474_y.func_216839_a(Integer.MIN_VALUE));
this.field_146415_a.render(p_render_1_, p_render_2_, p_render_3_);
if (this.field_195139_w != null) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screen/MainMenuScreen.java
+++ b/net/minecraft/client/gui/screen/MainMenuScreen.java
@@ -58,6 +58,7 @@
@@ -51,6 +51,7 @@
private final RenderSkybox field_209101_K = new RenderSkybox(field_213098_a);
private final boolean field_213102_y;
private long field_213103_z;
@@ -8,7 +8,7 @@
public MainMenuScreen() {
this(false);
@@ -108,10 +109,14 @@
@@ -98,10 +99,14 @@
this.field_193979_N = this.width - this.field_193978_M - 2;
int i = 24;
int j = this.height / 4 + 48;
@@ -23,7 +23,7 @@
}
this.addButton(new ImageButton(this.width / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.WIDGETS_LOCATION, 256, 256, (p_213090_1_) -> {
@@ -146,6 +151,7 @@
@@ -130,6 +135,7 @@
if (this.func_183501_a()) {
this.field_183503_M.init(this.minecraft, this.width, this.height);
}
@@ -31,7 +31,7 @@
}
@@ -156,7 +162,7 @@
@@ -140,7 +146,7 @@
this.addButton(new Button(this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, 200, 20, I18n.func_135052_a("menu.multiplayer"), (p_213086_1_) -> {
this.minecraft.func_147108_a(new MultiplayerScreen(this));
}));
@@ -40,7 +40,7 @@
this.func_140005_i();
}));
}
@@ -220,6 +226,7 @@
@@ -204,6 +210,7 @@
this.minecraft.func_110434_K().func_110577_a(field_194400_H);
blit(j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);
@@ -48,7 +48,7 @@
if (this.field_73975_c != null) {
GlStateManager.pushMatrix();
GlStateManager.translatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
@@ -238,7 +245,10 @@
@@ -222,7 +229,10 @@
s = s + ("release".equalsIgnoreCase(this.minecraft.func_184123_d()) ? "" : "/" + this.minecraft.func_184123_d());
}
@@ -60,7 +60,7 @@
this.drawString(this.font, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.height - 10, 16777215 | l);
if (p_render_1_ > this.field_193979_N && p_render_1_ < this.field_193979_N + this.field_193978_M && p_render_2_ > this.height - 10 && p_render_2_ < this.height) {
fill(this.field_193979_N, this.height - 1, this.field_193979_N + this.field_193978_M, this.height, 16777215 | l);
@@ -258,6 +268,7 @@
@@ -240,6 +250,7 @@
if (this.func_183501_a() && f1 >= 1.0F) {
this.field_183503_M.render(p_render_1_, p_render_2_, p_render_3_);
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screen/ServerListScreen.java
+++ b/net/minecraft/client/gui/screen/ServerListScreen.java
@@ -37,7 +37,7 @@
}));
this.field_146302_g = new TextFieldWidget(this.font, this.width / 2 - 100, 116, 200, 20, I18n.func_135052_a("addServer.enterIp"));
this.field_146302_g.func_146203_f(128);
- this.field_146302_g.func_146195_b(true);
+ this.field_146302_g.setFocused(true);
this.field_146302_g.func_146180_a(this.minecraft.field_71474_y.field_74332_R);
this.field_146302_g.func_212954_a((p_213024_1_) -> {
this.func_195168_i();
@@ -119,7 +119,7 @@
this.field_147008_s.clear();
(this.field_147002_h).field_148330_a.clear();
if (p_147050_1_ == ItemGroup.field_192395_m) {
@@ -494,19 +531,21 @@
@@ -494,13 +531,15 @@
}
if (this.field_147062_A != null) {
@@ -127,8 +127,7 @@
+ if (p_147050_1_.hasSearchBar()) {
this.field_147062_A.func_146189_e(true);
this.field_147062_A.func_146205_d(false);
- this.field_147062_A.func_146195_b(true);
+ this.field_147062_A.setFocused(true);
this.field_147062_A.func_146195_b(true);
if (i != p_147050_1_.func_78021_a()) {
this.field_147062_A.func_146180_a("");
}
@@ -137,13 +136,6 @@
this.func_147053_i();
} else {
this.field_147062_A.func_146189_e(false);
this.field_147062_A.func_146205_d(true);
- this.field_147062_A.func_146195_b(false);
+ this.field_147062_A.setFocused(false);
this.field_147062_A.func_146180_a("");
}
}
@@ -560,16 +599,35 @@
this.renderBackground();
super.render(p_render_1_, p_render_2_, p_render_3_);
@@ -1,56 +0,0 @@
--- a/net/minecraft/client/gui/widget/TextFieldWidget.java
+++ b/net/minecraft/client/gui/widget/TextFieldWidget.java
@@ -349,7 +349,7 @@
} else {
boolean flag = p_mouseClicked_1_ >= (double)this.x && p_mouseClicked_1_ < (double)(this.x + this.width) && p_mouseClicked_3_ >= (double)this.y && p_mouseClicked_3_ < (double)(this.y + this.height);
if (this.field_146212_n) {
- this.func_146195_b(flag);
+ this.setFocused(flag);
}
if (this.isFocused() && flag && p_mouseClicked_5_ == 0) {
@@ -358,7 +358,7 @@
i -= 4;
}
- String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.func_146200_o());
+ String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.getWidth());
this.func_146190_e(this.field_146211_a.func_78269_a(s, i).length() + this.field_146225_q);
return true;
} else {
@@ -367,7 +367,7 @@
}
}
- public void func_146195_b(boolean p_146195_1_) {
+ public void setFocused(boolean p_146195_1_) {
super.setFocused(p_146195_1_);
}
@@ -381,7 +381,7 @@
int i = this.field_146226_p ? this.field_146222_t : this.field_146221_u;
int j = this.field_146224_r - this.field_146225_q;
int k = this.field_146223_s - this.field_146225_q;
- String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.func_146200_o());
+ String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), this.getWidth());
boolean flag = j >= 0 && j <= s.length();
boolean flag1 = this.isFocused() && this.field_146214_l / 6 % 2 == 0 && flag;
int l = this.field_146215_m ? this.x + 4 : this.x;
@@ -522,7 +522,7 @@
this.field_146226_p = p_146184_1_;
}
- public int func_146200_o() {
+ public int getWidth() {
return this.func_146181_i() ? this.width - 8 : this.width;
}
@@ -534,7 +534,7 @@
this.field_146225_q = i;
}
- int j = this.func_146200_o();
+ int j = this.getWidth();
String s = this.field_146211_a.func_78269_a(this.field_146216_j.substring(this.field_146225_q), j);
int k = s.length() + this.field_146225_q;
if (this.field_146223_s == this.field_146225_q) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/network/play/ClientPlayNetHandler.java
+++ b/net/minecraft/client/network/play/ClientPlayNetHandler.java
@@ -712,7 +712,7 @@
@@ -711,7 +711,7 @@
BlockPos blockpos = new BlockPos(compoundnbt.func_74762_e("x"), compoundnbt.func_74762_e("y"), compoundnbt.func_74762_e("z"));
TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos);
if (tileentity != null) {
@@ -9,7 +9,7 @@
}
}
@@ -784,7 +784,9 @@
@@ -783,7 +783,9 @@
public void func_147251_a(SChatPacket p_147251_1_) {
PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f);
@@ -20,7 +20,7 @@
}
public void func_147279_a(SAnimateHandPacket p_147279_1_) {
@@ -956,6 +958,7 @@
@@ -955,6 +957,7 @@
this.field_147299_f.field_71439_g = clientplayerentity1;
this.field_147299_f.field_175622_Z = clientplayerentity1;
clientplayerentity1.func_184212_Q().func_187218_a(clientplayerentity.func_184212_Q().func_187231_c());
@@ -28,7 +28,7 @@
clientplayerentity1.func_70065_x();
clientplayerentity1.func_175158_f(s);
this.field_147300_g.func_217408_a(i, clientplayerentity1);
@@ -1078,6 +1081,12 @@
@@ -1077,6 +1080,12 @@
boolean flag = i == 2 && tileentity instanceof CommandBlockTileEntity;
if (i == 1 && tileentity instanceof MobSpawnerTileEntity || flag || i == 3 && tileentity instanceof BeaconTileEntity || i == 4 && tileentity instanceof SkullTileEntity || i == 6 && tileentity instanceof BannerTileEntity || i == 7 && tileentity instanceof StructureBlockTileEntity || i == 8 && tileentity instanceof EndGatewayTileEntity || i == 9 && tileentity instanceof SignTileEntity || i == 11 && tileentity instanceof BedTileEntity || i == 5 && tileentity instanceof ConduitTileEntity || i == 12 && tileentity instanceof JigsawTileEntity || i == 13 && tileentity instanceof CampfireTileEntity) {
tileentity.func_145839_a(p_147273_1_.func_148857_g());
@@ -41,7 +41,7 @@
}
if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) {
@@ -1252,6 +1261,7 @@
@@ -1246,6 +1255,7 @@
clientrecipebook.func_199644_c();
clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a);
imutablesearchtree.func_194040_a();
@@ -49,7 +49,7 @@
}
public void func_200232_a(SPlayerLookPacket p_200232_1_) {
@@ -1332,7 +1342,7 @@
@@ -1326,7 +1336,7 @@
PacketThreadUtil.func_218797_a(p_147260_1_, this, this.field_147299_f);
Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d());
if (entity instanceof LivingEntity) {
@@ -58,7 +58,7 @@
if (effect != null) {
EffectInstance effectinstance = new EffectInstance(effect, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f(), p_147260_1_.func_205527_h());
effectinstance.func_100012_b(p_147260_1_.func_149429_c());
@@ -1757,10 +1767,12 @@
@@ -1759,10 +1769,12 @@
this.field_147299_f.field_184132_p.field_217741_m.func_217692_a(pointofinterestdebugrenderer$braininfo);
} else {
@@ -1,19 +0,0 @@
--- a/net/minecraft/client/particle/Particle.java
+++ b/net/minecraft/client/particle/Particle.java
@@ -156,6 +156,7 @@
public void func_187110_a(double p_187110_1_, double p_187110_3_, double p_187110_5_) {
double d0 = p_187110_1_;
double d1 = p_187110_3_;
+ double origZ = p_187110_5_;
if (this.field_190017_n && p_187110_1_ != 0.0D || p_187110_3_ != 0.0D || p_187110_5_ != 0.0D) {
Vec3d vec3d = Entity.func_213313_a(new Vec3d(p_187110_1_, p_187110_3_, p_187110_5_), this.func_187116_l(), this.field_187122_b, ISelectionContext.func_216377_a(), new ReuseableStream<>(Stream.empty()));
p_187110_1_ = vec3d.field_72450_a;
@@ -173,7 +174,7 @@
this.field_187129_i = 0.0D;
}
- if (p_187110_5_ != p_187110_5_) {
+ if (origZ != p_187110_5_) {
this.field_187131_k = 0.0D;
}
@@ -13,7 +13,7 @@
public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) {
- if (!p_180533_2_.func_196958_f()) {
+ if (!p_180533_2_.isAir(this.field_78878_a, p_180533_1_)) {
+ if (!p_180533_2_.isAir(this.field_78878_a, p_180533_1_) && !p_180533_2_.addDestroyEffects(this.field_78878_a, p_180533_1_, this)) {
VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_);
double d0 = 0.25D;
voxelshape.func_197755_b((p_199284_3_, p_199284_5_, p_199284_7_, p_199284_9_, p_199284_11_, p_199284_13_) -> {
@@ -42,7 +42,7 @@
if (flag1) {
float f4 = hand == Hand.OFF_HAND ? f : 0.0F;
float f6 = 1.0F - MathHelper.func_219799_g(p_78440_1_, this.field_187472_i, this.field_187471_h);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.MAIN_HAND, p_78440_1_, f1, f4, f6, this.field_187467_d))
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(Hand.OFF_HAND, p_78440_1_, f1, f4, f6, this.field_187467_d))
this.func_187457_a(abstractclientplayerentity, p_78440_1_, f1, Hand.OFF_HAND, f4, this.field_187468_e, f6);
}
@@ -60,7 +60,7 @@
+ renderer.render(p_195465_1_, field_72769_h, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.THE_END) {
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.field_223229_c_) {
this.func_180448_r();
} else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
@@ -1113,6 +1122,7 @@
@@ -4,15 +4,15 @@
private Vec3d field_217672_l = Vec3d.field_186680_a;
public ChunkRenderDispatcher(boolean p_i51518_1_) {
+ this(p_i51518_1_,-1);
+ this(p_i51518_1_, -1);
+ }
+
+ public ChunkRenderDispatcher(boolean p_i51518_1_, int countRenderBuilders) {
int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760 - 1);
int j = Runtime.getRuntime().availableProcessors();
int k = p_i51518_1_ ? j : Math.min(j, 4);
- int l = Math.max(1, Math.min(k * 3, i));
+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k * 3, i)) : countRenderBuilders;
- int l = Math.max(1, Math.min(k * 2, i));
+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k * 2, i)) : countRenderBuilders;
this.field_178525_i = new ChunkRenderWorker(this, new RegionRenderCacheBuilder());
List<RegionRenderCacheBuilder> list = Lists.newArrayListWithExpectedSize(l);
@@ -1,10 +1,7 @@
--- a/net/minecraft/client/renderer/entity/EntityRendererManager.java
+++ b/net/minecraft/client/renderer/entity/EntityRendererManager.java
@@ -255,8 +255,13 @@
this.field_178637_m = new PlayerRenderer(this);
this.field_178636_l.put("default", this.field_178637_m);
@@ -257,6 +257,10 @@
this.field_178636_l.put("slim", new PlayerRenderer(this, true));
+ net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.field_78729_o);
}
+ public Map<String, PlayerRenderer> getSkinMap() {
@@ -2,7 +2,7 @@
+++ b/net/minecraft/client/renderer/entity/PlayerRenderer.java
@@ -52,6 +52,7 @@
public void func_76986_a(AbstractClientPlayerEntity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_217783_c.func_216773_g() == p_76986_1_) {
if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_217783_c != null && this.field_76990_c.field_217783_c.func_216773_g() == p_76986_1_) {
double d0 = p_76986_4_;
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return;
if (p_76986_1_.func_213287_bg()) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/entity/layers/ArmorLayer.java
+++ b/net/minecraft/client/renderer/entity/layers/ArmorLayer.java
@@ -55,12 +55,13 @@
@@ -55,24 +55,25 @@
ArmorItem armoritem = (ArmorItem)itemstack.func_77973_b();
if (armoritem.func_185083_B_() == p_188361_9_) {
A a = this.func_215337_a(p_188361_9_);
@@ -16,7 +16,12 @@
int i = ((DyeableArmorItem)armoritem).func_200886_f(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
@@ -72,7 +73,7 @@
float f2 = (float)(i & 255) / 255.0F;
GlStateManager.color4f(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e);
a.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
- this.func_215333_a(this.func_177178_a(armoritem, flag, "overlay"));
+ this.func_215333_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, "overlay"));
}
GlStateManager.color4f(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e);
a.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
@@ -10,38 +10,43 @@
public boolean func_178309_b() {
return this.field_178315_d != null ? this.field_178315_d.func_178309_b() : this.field_178322_i;
}
@@ -87,6 +90,10 @@
return this.field_187968_k;
}
+ public ItemOverrideList getOverrides(BlockModel model, Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> spriteGetter) {
+ return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(model, modelGetter, this.field_187968_k, spriteGetter);
+ }
+
@@ -90,6 +93,10 @@
private ItemOverrideList func_217646_a(ModelBakery p_217646_1_, BlockModel p_217646_2_) {
return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(p_217646_1_, p_217646_2_, p_217646_1_::func_209597_a, this.field_187968_k);
}
@@ -160,25 +167,26 @@
+
+ public ItemOverrideList getOverrides(ModelBakery p_217646_1_, BlockModel p_217646_2_, Function<ResourceLocation, TextureAtlasSprite> textureGetter, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ return this.field_187968_k.isEmpty() ? ItemOverrideList.field_188022_a : new ItemOverrideList(p_217646_1_, p_217646_2_, p_217646_1_::func_209597_a, textureGetter, this.field_187968_k, format);
+ }
public Collection<ResourceLocation> func_187965_e() {
Set<ResourceLocation> set = Sets.newHashSet();
@@ -160,25 +167,33 @@
return set1;
}
- public IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
- return this.func_217644_a(p_217641_1_, this, p_217641_2_, p_217641_3_);
- }
+ @Nullable
+ @Override
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_217644_1_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_2_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT))
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
+ // FORGE: Override our interface method, binary compatible
+ public IBakedModel bake(ModelBakery bakery, Function<ResourceLocation, TextureAtlasSprite> spriteGetter, ISprite sprite, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT))
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
+ return this.bake(bakery, this, spriteGetter, sprite, format);
}
- public IBakedModel func_217644_a(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_) {
+ @Deprecated
public IBakedModel func_217644_a(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_) {
+ return bake(p_217644_1_, p_217644_2_, p_217644_3_, p_217644_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+
+ public IBakedModel bake(ModelBakery p_217644_1_, BlockModel p_217644_2_, Function<ResourceLocation, TextureAtlasSprite> p_217644_3_, ISprite p_217644_4_, net.minecraft.client.renderer.vertex.VertexFormat format) {
TextureAtlasSprite textureatlassprite = p_217644_3_.apply(new ResourceLocation(this.func_178308_c("particle")));
if (this.func_178310_f() == ModelBakery.field_177616_r) {
- return new BuiltInModel(this.func_181682_g(), this.func_217646_a(p_217644_1_, p_217644_2_), textureatlassprite);
+ return new BuiltInModel(this.func_181682_g(), this.getOverrides(this, p_217644_1_, p_217644_3_), textureatlassprite);
+ return new BuiltInModel(this.func_181682_g(), this.getOverrides(p_217644_1_, p_217644_2_, p_217644_3_, format), textureatlassprite);
} else {
- SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(this, this.func_217646_a(p_217644_1_, p_217644_2_))).func_177646_a(textureatlassprite);
+ SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(this, this.getOverrides(this, p_217644_1_, p_217644_3_))).func_177646_a(textureatlassprite);
+ SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(this, this.getOverrides(p_217644_1_, p_217644_2_, p_217644_3_, format))).func_177646_a(textureatlassprite);
for(BlockPart blockpart : this.func_178298_a()) {
for(Direction direction : blockpart.field_178240_c.keySet()) {
@@ -49,14 +54,14 @@
TextureAtlasSprite textureatlassprite1 = p_217644_3_.apply(new ResourceLocation(this.func_178308_c(blockpartface.field_178242_d)));
if (blockpartface.field_178244_b == null) {
- simplebakedmodel$builder.func_177648_a(func_217645_a(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_2_));
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
} else {
- simplebakedmodel$builder.func_177650_a(p_217644_4_.func_188048_b().func_177523_a(blockpartface.field_178244_b), func_217645_a(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
+ simplebakedmodel$builder.func_177650_a(p_217644_2_.getState().apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(direction)).orElse(direction), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_2_));
+ simplebakedmodel$builder.func_177650_a(p_217644_4_.getState().apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(blockpartface.field_178244_b)).orElse(blockpartface.field_178244_b), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
}
}
}
@@ -191,6 +199,10 @@
@@ -191,6 +206,10 @@
return field_217647_g.func_217648_a(p_217645_0_.field_178241_a, p_217645_0_.field_178239_b, p_217645_1_, p_217645_2_, p_217645_3_, p_217645_4_, p_217645_0_.field_178237_d, p_217645_0_.field_178238_e);
}
@@ -17,6 +17,6 @@
- IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_);
+ @Deprecated
+ default IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
+ return bake(p_217641_1_::func_209597_a, p_217641_2_, p_217641_3_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ return bake(p_217641_1_, p_217641_2_, p_217641_3_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
}
@@ -1,25 +1,22 @@
--- a/net/minecraft/client/renderer/model/ItemOverrideList.java
+++ b/net/minecraft/client/renderer/model/ItemOverrideList.java
@@ -24,10 +24,17 @@
@@ -24,10 +24,14 @@
this.field_209582_c = Collections.emptyList();
}
+ @Deprecated //Forge: Use IUnbakedModel
+ @Deprecated //Forge: Use IUnbakedModel, add texture getter
public ItemOverrideList(ModelBakery p_i50984_1_, BlockModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, List<ItemOverride> p_i50984_4_) {
+ this(p_i50984_1_, (IUnbakedModel)p_i50984_2_, p_i50984_3_, p_i50984_4_);
+ this(p_i50984_1_, (IUnbakedModel)p_i50984_2_, p_i50984_3_, p_i50984_1_.field_177609_j::func_195424_a, p_i50984_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+ public ItemOverrideList(ModelBakery p_i50984_1_, IUnbakedModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, List<ItemOverride> p_i50984_4_) {
+ this(p_i50984_2_, p_i50984_3_, p_i50984_4_, net.minecraftforge.client.model.ModelLoader.defaultTextureGetter());
+ }
+ public ItemOverrideList(IUnbakedModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, List<ItemOverride> p_i50984_4_, Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> spriteGetter) {
+ public ItemOverrideList(ModelBakery p_i50984_1_, IUnbakedModel p_i50984_2_, Function<ResourceLocation, IUnbakedModel> p_i50984_3_, Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, List<ItemOverride> p_i50984_4_, net.minecraft.client.renderer.vertex.VertexFormat format) {
this.field_209582_c = p_i50984_4_.stream().map((p_217649_3_) -> {
IUnbakedModel iunbakedmodel = p_i50984_3_.apply(p_217649_3_.func_188026_a());
- return Objects.equals(iunbakedmodel, p_i50984_2_) ? null : p_i50984_1_.func_217845_a(p_217649_3_.func_188026_a(), ModelRotation.X0_Y0);
+ return Objects.equals(iunbakedmodel, p_i50984_2_) ? null : p_i50984_3_.apply(p_217649_3_.func_188026_a()).bake(p_i50984_3_, spriteGetter, ModelRotation.X0_Y0, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ return Objects.equals(iunbakedmodel, p_i50984_2_) ? null : p_i50984_1_.getBakedModel(p_217649_3_.func_188026_a(), ModelRotation.X0_Y0, textureGetter, format);
}).collect(Collectors.toList());
Collections.reverse(this.field_209582_c);
@@ -55,4 +62,8 @@
@@ -55,4 +59,8 @@
return p_209581_1_;
}
@@ -18,21 +18,31 @@
return pair1;
} catch (Exception exception1) {
throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_217839_1_.func_199029_a(), p_217839_1_.func_199026_d(), exception1.getMessage()));
@@ -381,7 +381,7 @@
@@ -381,7 +381,12 @@
@Nullable
public IBakedModel func_217845_a(ResourceLocation p_217845_1_, ISprite p_217845_2_) {
- Triple<ResourceLocation, ModelRotation, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.func_188048_b(), p_217845_2_.func_188049_c());
+ return getBakedModel(p_217845_1_, p_217845_2_, this.field_177609_j::func_195424_a, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+
+ @Nullable
+ public IBakedModel getBakedModel(ResourceLocation p_217845_1_, ISprite p_217845_2_, java.util.function.Function<ResourceLocation, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ Triple<ResourceLocation, net.minecraftforge.common.model.IModelState, Boolean> triple = Triple.of(p_217845_1_, p_217845_2_.getState(), p_217845_2_.func_188049_c());
if (this.field_217850_G.containsKey(triple)) {
return this.field_217850_G.get(triple);
} else {
@@ -389,7 +389,7 @@
@@ -389,11 +394,11 @@
if (iunbakedmodel instanceof BlockModel) {
BlockModel blockmodel = (BlockModel)iunbakedmodel;
if (blockmodel.func_178310_f() == field_177606_o) {
- return field_217854_z.func_209579_a(this.field_177609_j::func_195424_a, blockmodel).func_217644_a(this, blockmodel, this.field_177609_j::func_195424_a, p_217845_2_);
+ return field_217854_z.func_209579_a(this.field_177609_j::func_195424_a, blockmodel).bake(this::func_209597_a, this.field_177609_j::func_195424_a, p_217845_2_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ return field_217854_z.func_209579_a(textureGetter, blockmodel).func_217644_a(this, blockmodel, textureGetter, p_217845_2_);
}
}
- IBakedModel ibakedmodel = iunbakedmodel.func_217641_a(this, this.field_177609_j::func_195424_a, p_217845_2_);
+ IBakedModel ibakedmodel = iunbakedmodel.bake(this, this.field_177609_j::func_195424_a, p_217845_2_, format);
this.field_217850_G.put(triple, ibakedmodel);
return ibakedmodel;
}
@@ -26,3 +26,11 @@
p_212854_2_.func_219897_b();
return modelbakery;
}
@@ -47,6 +53,7 @@
p_212853_1_.func_217844_a(p_212853_3_);
this.field_174958_a = p_212853_1_.func_217846_a();
this.field_174955_d = this.field_174958_a.get(ModelBakery.field_177604_a);
+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, (net.minecraftforge.client.model.ModelLoader) p_212853_1_);
p_212853_3_.func_219895_b("cache");
this.field_174957_c.func_178124_c();
p_212853_3_.func_76319_b();
@@ -6,7 +6,7 @@
@Nullable
- public IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
+ @Override
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ public IBakedModel bake(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
if (this.func_188114_a().isEmpty()) {
return null;
} else {
@@ -14,7 +14,7 @@
for(Variant variant : this.func_188114_a()) {
- IBakedModel ibakedmodel = p_217641_1_.func_217845_a(variant.func_188046_a(), variant);
+ IBakedModel ibakedmodel = p_217641_1_.apply(variant.func_188046_a()).bake(p_217641_1_, p_217641_2_, variant, format);
+ IBakedModel ibakedmodel = p_217641_1_.getBakedModel(variant.func_188046_a(), variant, p_217641_2_, format);
weightedbakedmodel$builder.func_177677_a(ibakedmodel, variant.func_188047_d());
}
@@ -6,7 +6,7 @@
@Nullable
- public IBakedModel func_217641_a(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_) {
+ @Override
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
+ public IBakedModel bake(ModelBakery p_217641_1_, Function<ResourceLocation, TextureAtlasSprite> p_217641_2_, ISprite p_217641_3_, net.minecraft.client.renderer.vertex.VertexFormat format) {
MultipartBakedModel.Builder multipartbakedmodel$builder = new MultipartBakedModel.Builder();
for(Selector selector : this.func_188136_a()) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java
+++ b/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java
@@ -67,6 +67,7 @@
@@ -70,6 +70,7 @@
}
private boolean func_188186_a(BlockPos p_188186_1_, BlockState p_188186_2_, BufferBuilder p_188186_3_, World p_188186_4_, boolean p_188186_5_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/resources/JsonReloadListener.java
+++ b/net/minecraft/client/resources/JsonReloadListener.java
@@ -61,4 +61,8 @@
return map;
}
+
+ protected ResourceLocation getPreparedPath(ResourceLocation rl) {
+ return new ResourceLocation(rl.func_110624_b(), this.field_223383_d + "/" + rl.func_110623_a() + ".json");
+ }
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/world/ClientWorld.java
+++ b/net/minecraft/client/world/ClientWorld.java
@@ -86,6 +86,8 @@
@@ -87,6 +87,8 @@
this.func_175652_B(new BlockPos(8, 64, 8));
this.func_72966_v();
this.func_72947_a();
@@ -9,7 +9,7 @@
}
public void func_72835_b(BooleanSupplier p_72835_1_) {
@@ -110,6 +112,7 @@
@@ -111,6 +113,7 @@
Entity entity = this.field_217428_a.get(i);
this.func_217390_a((p_217415_0_) -> {
++p_217415_0_.field_70173_aa;
@@ -17,7 +17,7 @@
p_217415_0_.func_70071_h_();
}, entity);
if (entity.field_70128_L) {
@@ -157,6 +160,7 @@
@@ -158,6 +161,7 @@
this.func_217381_Z().func_194340_a(() -> {
return Registry.field_212629_r.func_177774_c(p_217418_1_.func_200600_R()).toString();
});
@@ -25,7 +25,11 @@
p_217418_1_.func_70071_h_();
this.func_217381_Z().func_76319_b();
}
@@ -267,6 +271,7 @@
@@ -265,9 +269,11 @@
}
private void func_217424_b(int p_217424_1_, Entity p_217424_2_) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_217424_2_, this))) return;
this.func_217413_d(p_217424_1_);
this.field_217429_b.put(p_217424_1_, p_217424_2_);
this.func_72863_F().func_212849_a_(MathHelper.func_76128_c(p_217424_2_.field_70165_t / 16.0D), MathHelper.func_76128_c(p_217424_2_.field_70161_v / 16.0D), ChunkStatus.field_222617_m, true).func_76612_a(p_217424_2_);
@@ -33,7 +37,7 @@
}
public void func_217413_d(int p_217413_1_) {
@@ -285,6 +290,7 @@
@@ -286,6 +292,7 @@
}
this.field_217431_w.remove(p_217414_1_);
@@ -41,7 +45,7 @@
}
public void func_217417_b(Chunk p_217417_1_) {
@@ -410,6 +416,11 @@
@@ -411,6 +418,11 @@
}
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_) {
@@ -53,7 +57,7 @@
if (p_184148_1_ == this.field_73037_M.field_71439_g) {
this.func_184134_a(p_184148_2_, p_184148_4_, p_184148_6_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_, false);
}
@@ -417,6 +428,11 @@
@@ -418,6 +430,11 @@
}
public void func_217384_a(@Nullable PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) {
@@ -0,0 +1,22 @@
--- a/net/minecraft/data/DataGenerator.java
+++ b/net/minecraft/data/DataGenerator.java
@@ -19,7 +19,7 @@
public DataGenerator(Path p_i48266_1_, Collection<Path> p_i48266_2_) {
this.field_200395_c = p_i48266_1_;
- this.field_200394_b = p_i48266_2_;
+ this.field_200394_b = Lists.newArrayList(p_i48266_2_);
}
public Collection<Path> func_200389_a() {
@@ -53,6 +53,10 @@
this.field_200396_d.add(p_200390_1_);
}
+ public void addInput(Path value) {
+ this.field_200394_b.add(value);
+ }
+
static {
Bootstrap.func_151354_b();
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/data/DirectoryCache.java
+++ b/net/minecraft/data/DirectoryCache.java
@@ -23,7 +23,7 @@
private final Path field_208326_c;
private int field_208327_d;
private final Map<Path, String> field_208328_e = Maps.newHashMap();
- private final Map<Path, String> field_208329_f = Maps.newHashMap();
+ private final Map<Path, String> field_208329_f = Maps.newTreeMap(); //Forge: TreeMap, makes the file output predictable/sorted.
private final Set<Path> field_218457_g = Sets.newHashSet();
public DirectoryCache(Path p_i49352_1_, String p_i49352_2_) throws IOException {
@@ -0,0 +1,37 @@
--- a/net/minecraft/data/Main.java
+++ b/net/minecraft/data/Main.java
@@ -1,5 +1,6 @@
package net.minecraft.data;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -21,8 +22,10 @@
OptionSpec<Void> optionspec6 = optionparser.accepts("all", "Include all generators");
OptionSpec<String> optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
OptionSpec<String> optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg();
+ OptionSpec<File> gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File(".")).required();
+ OptionSpec<String> mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(",");
OptionSet optionset = optionparser.parse(p_main_0_);
- if (!optionset.has(optionspec) && optionset.hasOptions()) {
+ if (!optionset.has(optionspec) && optionset.hasOptions() && !(optionset.specs().size() == 1 && optionset.has(gameDir))) {
Path path = Paths.get(optionspec7.value(optionset));
boolean flag = optionset.has(optionspec6);
boolean flag1 = flag || optionset.has(optionspec2);
@@ -30,10 +33,11 @@
boolean flag3 = flag || optionset.has(optionspec3);
boolean flag4 = flag || optionset.has(optionspec4);
boolean flag5 = flag || optionset.has(optionspec5);
- DataGenerator datagenerator = func_200264_a(path, optionset.valuesOf(optionspec8).stream().map((p_200263_0_) -> {
- return Paths.get(p_200263_0_);
- }).collect(Collectors.toList()), flag1, flag2, flag3, flag4, flag5);
- datagenerator.func_200392_c();
+ Collection<Path> inputs = optionset.valuesOf(optionspec8).stream().map(Paths::get).collect(Collectors.toList());
+ java.util.Set<String> mods = new java.util.HashSet<>(optionset.valuesOf(mod));
+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, flag2, flag1, flag3, flag4, flag5);
+ if (mods.contains("minecraft") || mods.isEmpty())
+ func_200264_a(mods.isEmpty() ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c();
} else {
optionparser.printHelpOn(System.out);
}
@@ -9,7 +9,7 @@
private final EquipmentSlotType[] field_185263_a;
private final Enchantment.Rarity field_77333_a;
@Nullable
@@ -110,7 +110,7 @@
@@ -114,7 +114,7 @@
}
public boolean func_92089_a(ItemStack p_92089_1_) {
@@ -18,7 +18,7 @@
}
public void func_151368_a(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) {
@@ -127,12 +127,31 @@
@@ -131,6 +131,24 @@
return false;
}
@@ -41,12 +41,5 @@
+ }
+
public static enum Rarity {
COMMON(30),
UNCOMMON(10),
RARE(3),
VERY_RARE(1);
+
private final int field_185275_e;
private Rarity(int p_i47026_3_) {
COMMON(10),
UNCOMMON(5),
@@ -1,6 +1,6 @@
--- a/net/minecraft/enchantment/EnchantmentHelper.java
+++ b/net/minecraft/enchantment/EnchantmentHelper.java
@@ -257,7 +257,7 @@
@@ -258,7 +258,7 @@
public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) {
Item item = p_77514_3_.func_77973_b();
@@ -9,7 +9,7 @@
if (i <= 0) {
return 0;
} else {
@@ -295,7 +295,7 @@
@@ -296,7 +296,7 @@
public static List<EnchantmentData> func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) {
List<EnchantmentData> list = Lists.newArrayList();
Item item = p_77513_1_.func_77973_b();
@@ -18,12 +18,12 @@
if (i <= 0) {
return list;
} else {
@@ -354,7 +354,7 @@
@@ -349,7 +349,7 @@
boolean flag = p_185291_1_.func_77973_b() == Items.field_151122_aG;
for(Enchantment enchantment : Registry.field_212628_q) {
- if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.field_77351_y.func_77557_a(item) || flag)) {
+ if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) {
for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) {
if (p_185291_0_ >= enchantment.func_77321_a(i)) {
if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) {
list.add(new EnchantmentData(enchantment, i));
@@ -1,6 +1,6 @@
--- a/net/minecraft/enchantment/FrostWalkerEnchantment.java
+++ b/net/minecraft/enchantment/FrostWalkerEnchantment.java
@@ -38,9 +38,10 @@
@@ -42,9 +42,10 @@
if (blockpos.func_218137_a(p_185266_0_.func_213303_ch(), (double)f)) {
blockpos$mutableblockpos.func_181079_c(blockpos.func_177958_n(), blockpos.func_177956_o() + 1, blockpos.func_177952_p());
BlockState blockstate1 = p_185266_1_.func_180495_p(blockpos$mutableblockpos);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/Entity.java
+++ b/net/minecraft/entity/Entity.java
@@ -103,12 +103,13 @@
@@ -104,12 +104,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -15,7 +15,7 @@
private final EntityType<?> field_200606_g;
private int field_145783_c = field_213331_b.incrementAndGet();
public boolean field_70156_m;
@@ -135,6 +136,7 @@
@@ -136,6 +137,7 @@
public boolean field_70132_H;
public boolean field_70133_I;
protected Vec3d field_213328_B = Vec3d.field_186680_a;
@@ -23,7 +23,7 @@
public boolean field_70128_L;
public float field_70141_P;
public float field_70140_Q;
@@ -196,6 +198,7 @@
@@ -197,6 +199,7 @@
private float field_213326_aJ;
public Entity(EntityType<?> p_i48580_1_, World p_i48580_2_) {
@@ -31,7 +31,7 @@
this.field_200606_g = p_i48580_1_;
this.field_70170_p = p_i48580_2_;
this.field_213325_aI = p_i48580_1_.func_220334_j();
@@ -213,7 +216,9 @@
@@ -214,7 +217,9 @@
this.field_70180_af.func_187214_a(field_189655_aD, false);
this.field_70180_af.func_187214_a(field_213330_X, Pose.STANDING);
this.func_70088_a();
@@ -42,7 +42,7 @@
}
public boolean func_175149_v() {
@@ -302,7 +307,13 @@
@@ -303,7 +308,13 @@
}
public void func_70106_y() {
@@ -56,7 +56,7 @@
}
protected void func_213301_b(Pose p_213301_1_) {
@@ -322,6 +333,7 @@
@@ -323,6 +334,7 @@
this.field_70165_t = p_70107_1_;
this.field_70163_u = p_70107_3_;
this.field_70161_v = p_70107_5_;
@@ -64,7 +64,7 @@
float f = this.field_213325_aI.field_220315_a / 2.0F;
float f1 = this.field_213325_aI.field_220316_b;
this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f));
@@ -487,7 +499,7 @@
@@ -496,7 +508,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -73,7 +73,7 @@
BlockPos blockpos1 = blockpos.func_177977_b();
BlockState blockstate1 = this.field_70170_p.func_180495_p(blockpos1);
Block block = blockstate1.func_177230_c();
@@ -526,7 +538,7 @@
@@ -535,7 +547,7 @@
this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(func_213296_b(vec3d)) * 0.6D);
this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d2 * d2 + d0 * d0 + d1 * d1) * 0.6D);
@@ -82,7 +82,7 @@
this.field_70150_b = this.func_203009_ad();
if (this.func_70090_H()) {
Entity entity = this.func_184207_aI() && this.func_184179_bs() != null ? this.func_184179_bs() : this;
@@ -541,7 +553,7 @@
@@ -550,7 +562,7 @@
} else {
this.func_180429_a(blockpos, blockstate);
}
@@ -91,7 +91,7 @@
this.field_191959_ay = this.func_191954_d(this.field_82151_R);
}
}
@@ -743,6 +755,7 @@
@@ -792,6 +804,7 @@
this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
this.field_70163_u = axisalignedbb.field_72338_b;
this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
@@ -99,7 +99,7 @@
}
protected SoundEvent func_184184_Z() {
@@ -795,7 +808,7 @@
@@ -844,7 +857,7 @@
protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) {
if (!p_180429_2_.func_185904_a().func_76224_d()) {
BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a());
@@ -108,7 +108,7 @@
this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
}
}
@@ -991,6 +1004,7 @@
@@ -1040,6 +1053,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -116,7 +116,7 @@
if (blockstate.func_185901_i() != BlockRenderType.INVISIBLE) {
Vec3d vec3d = this.func_213322_ci();
this.field_70170_p.func_195594_a(new BlockParticleData(ParticleTypes.field_197611_d, blockstate), this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_213325_aI.field_220315_a, this.field_70163_u + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_213325_aI.field_220315_a, vec3d.field_72450_a * -4.0D, 1.5D, vec3d.field_72449_c * -4.0D);
@@ -1012,7 +1026,7 @@
@@ -1061,7 +1075,7 @@
return false;
} else {
IFluidState ifluidstate = this.field_70170_p.func_204610_c(blockpos);
@@ -125,7 +125,7 @@
}
}
}
@@ -1083,6 +1097,7 @@
@@ -1132,6 +1146,7 @@
this.field_70126_B -= 360.0F;
}
@@ -133,7 +133,7 @@
this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
this.func_70101_b(p_70080_7_, p_70080_8_);
}
@@ -1319,6 +1334,7 @@
@@ -1368,6 +1383,7 @@
if (this.field_184238_ar) {
p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
}
@@ -141,7 +141,7 @@
if (!this.field_184236_aF.isEmpty()) {
ListNBT listnbt = new ListNBT();
@@ -1330,6 +1346,10 @@
@@ -1379,6 +1395,10 @@
p_189511_1_.func_218657_a("Tags", listnbt);
}
@@ -152,7 +152,7 @@
this.func_213281_b(p_189511_1_);
if (this.func_184207_aI()) {
ListNBT listnbt1 = new ListNBT();
@@ -1406,6 +1426,9 @@
@@ -1455,6 +1475,9 @@
this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
@@ -162,7 +162,7 @@
if (p_70020_1_.func_150297_b("Tags", 9)) {
this.field_184236_aF.clear();
ListNBT listnbt1 = p_70020_1_.func_150295_c("Tags", 8);
@@ -1494,6 +1517,8 @@
@@ -1543,6 +1566,8 @@
} else {
ItemEntity itementity = new ItemEntity(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_);
itementity.func_174869_p();
@@ -171,7 +171,7 @@
this.field_70170_p.func_217376_c(itementity);
return itementity;
}
@@ -1537,6 +1562,7 @@
@@ -1586,6 +1611,7 @@
public void func_70098_U() {
this.func_213317_d(Vec3d.field_186680_a);
@@ -179,7 +179,7 @@
this.func_70071_h_();
if (this.func_184218_aH()) {
this.func_184187_bx().func_184232_k(this);
@@ -1577,6 +1603,7 @@
@@ -1626,6 +1652,7 @@
}
}
@@ -187,7 +187,7 @@
if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
if (this.func_184218_aH()) {
this.func_184210_p();
@@ -1608,6 +1635,7 @@
@@ -1657,6 +1684,7 @@
public void func_184210_p() {
if (this.field_184239_as != null) {
Entity entity = this.field_184239_as;
@@ -195,7 +195,7 @@
this.field_184239_as = null;
entity.func_184225_p(this);
}
@@ -1758,6 +1786,7 @@
@@ -1807,6 +1835,7 @@
return !this.func_184188_bt().isEmpty();
}
@@ -203,7 +203,7 @@
public boolean func_205710_ba() {
return true;
}
@@ -1956,7 +1985,7 @@
@@ -2005,7 +2034,7 @@
func_207712_c(itextcomponent1);
return itextcomponent1;
} else {
@@ -212,7 +212,7 @@
}
}
@@ -2014,6 +2043,7 @@
@@ -2063,6 +2092,7 @@
@Nullable
public Entity func_212321_a(DimensionType p_212321_1_) {
@@ -220,28 +220,27 @@
if (!this.field_70170_p.field_72995_K && !this.field_70128_L) {
this.field_70170_p.func_217381_Z().func_76320_a("changeDimension");
MinecraftServer minecraftserver = this.func_184102_h();
@@ -2031,17 +2061,9 @@
} else if (p_212321_1_ == DimensionType.THE_END) {
@@ -2080,16 +2110,9 @@
} else if (p_212321_1_ == DimensionType.field_223229_c_) {
blockpos = serverworld1.func_180504_m();
} else {
- double d0 = this.field_70165_t;
- double d1 = this.field_70161_v;
- double d2 = 8.0D;
- if (dimensiontype == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.NETHER) {
- if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223228_b_) {
- d0 /= 8.0D;
- d1 /= 8.0D;
- } else if (dimensiontype == DimensionType.NETHER && p_212321_1_ == DimensionType.OVERWORLD) {
- } else if (dimensiontype == DimensionType.field_223228_b_ && p_212321_1_ == DimensionType.field_223227_a_) {
- d0 *= 8.0D;
- d1 *= 8.0D;
- }
-
+ double movementFactor = serverworld.func_201675_m().getMovementFactor() / serverworld1.func_201675_m().getMovementFactor();
+ double d0 = this.field_70165_t * movementFactor;
+ double d1 = this.field_70161_v * movementFactor;
double d3 = Math.min(-2.9999872E7D, serverworld1.func_175723_af().func_177726_b() + 16.0D);
double d4 = Math.min(-2.9999872E7D, serverworld1.func_175723_af().func_177736_c() + 16.0D);
double d5 = Math.min(2.9999872E7D, serverworld1.func_175723_af().func_177728_d() - 16.0D);
@@ -2069,7 +2091,6 @@
@@ -2118,7 +2141,6 @@
serverworld1.func_217460_e(entity);
}
@@ -249,7 +248,7 @@
this.field_70170_p.func_217381_Z().func_76319_b();
serverworld.func_82742_i();
serverworld1.func_82742_i();
@@ -2225,7 +2246,7 @@
@@ -2274,7 +2296,7 @@
Pose pose = this.func_213283_Z();
EntitySize entitysize1 = this.func_213305_a(pose);
this.field_213325_aI = entitysize1;
@@ -258,7 +257,7 @@
if (entitysize1.field_220315_a < entitysize.field_220315_a) {
double d0 = (double)entitysize1.field_220315_a / 2.0D;
this.func_174826_a(new AxisAlignedBB(this.field_70165_t - d0, this.field_70163_u, this.field_70161_v - d0, this.field_70165_t + d0, this.field_70163_u + (double)entitysize1.field_220316_b, this.field_70161_v + d0));
@@ -2592,6 +2613,7 @@
@@ -2641,6 +2663,7 @@
return this.field_211517_W;
}
@@ -266,7 +265,7 @@
public final float func_213311_cf() {
return this.field_213325_aI.field_220315_a;
}
@@ -2621,4 +2643,69 @@
@@ -2670,4 +2693,69 @@
public void func_213293_j(double p_213293_1_, double p_213293_3_, double p_213293_5_) {
this.func_213317_d(new Vec3d(p_213293_1_, p_213293_3_, p_213293_5_));
}
@@ -329,7 +328,7 @@
+ this.field_70128_L = false;
+ this.reviveCaps();
+ }
+
+
+ private float getEyeHeightForge(Pose pose, EntitySize size) {
+ net.minecraftforge.event.entity.EntityEvent.EyeHeight evt = new net.minecraftforge.event.entity.EntityEvent.EyeHeight(this, pose, size, this.func_213316_a(pose, size));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(evt);
@@ -1,33 +1,27 @@
--- a/net/minecraft/entity/EntitySpawnPlacementRegistry.java
+++ b/net/minecraft/entity/EntitySpawnPlacementRegistry.java
@@ -9,6 +9,7 @@
private static final Map<EntityType<?>, EntitySpawnPlacementRegistry.Entry> field_209347_a = Maps.newHashMap();
private static void func_209343_a(EntityType<?> p_209343_0_, EntitySpawnPlacementRegistry.PlacementType p_209343_1_, Heightmap.Type p_209343_2_) {
+ if (field_209347_a.containsKey(p_209343_0_)) throw new IllegalArgumentException("Invalid register call, " + p_209343_0_ + " already registered.");
field_209347_a.put(p_209343_0_, new EntitySpawnPlacementRegistry.Entry(p_209343_2_, p_209343_1_));
}
@@ -87,8 +88,23 @@
}
@@ -141,9 +141,25 @@
boolean test(EntityType<T> p_test_1_, IWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_);
}
- public static enum PlacementType {
+ public static enum PlacementType implements net.minecraftforge.common.IExtensibleEnum {
ON_GROUND,
IN_WATER;
IN_WATER,
NO_RESTRICTIONS;
+
+ public static PlacementType create(String name, net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, net.minecraft.util.math.BlockPos, EntityType<? extends MobEntity>> predicate) {
+ public static PlacementType create(String name, net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, BlockPos, EntityType<? extends MobEntity>> predicate) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ private net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, net.minecraft.util.math.BlockPos, EntityType<?>> predicate;
+ private net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, BlockPos, EntityType<?>> predicate;
+ private PlacementType() { this(null); }
+ private PlacementType(net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, net.minecraft.util.math.BlockPos, EntityType<?>> predicate) {
+ private PlacementType(net.minecraftforge.common.util.TriPredicate<net.minecraft.world.IWorldReader, BlockPos, EntityType<?>> predicate) {
+ this.predicate = predicate;
+ }
+
+ public boolean canSpawnAt(net.minecraft.world.IWorldReader world, net.minecraft.util.math.BlockPos pos, EntityType<?> type) {
+ public boolean canSpawnAt(net.minecraft.world.IWorldReader world, BlockPos pos, EntityType<?> type) {
+ if (this == NO_RESTRICTIONS) return true;
+ if (predicate == null) return net.minecraft.world.spawner.WorldEntitySpawner.canSpawnAtBody(this, world, pos, type);
+ return predicate.test(world, pos, type);
+ }
@@ -9,7 +9,7 @@
private static final Logger field_200731_aJ = LogManager.getLogger();
public static final EntityType<AreaEffectCloudEntity> field_200788_b = func_200712_a("area_effect_cloud", EntityType.Builder.<AreaEffectCloudEntity>func_220322_a(AreaEffectCloudEntity::new, EntityClassification.MISC).func_220320_c().func_220321_a(6.0F, 0.5F));
public static final EntityType<ArmorStandEntity> field_200789_c = func_200712_a("armor_stand", EntityType.Builder.<ArmorStandEntity>func_220322_a(ArmorStandEntity::new, EntityClassification.MISC).func_220321_a(0.5F, 1.975F));
@@ -254,6 +254,11 @@
@@ -254,6 +254,12 @@
private final Type<?> field_206832_aX;
private final EntitySize field_220359_bi;
@@ -17,11 +17,12 @@
+ private final java.util.function.ToIntFunction<EntityType<?>> trackingRangeSupplier;
+ private final java.util.function.ToIntFunction<EntityType<?>> updateIntervalSupplier;
+ private final java.util.function.BiFunction<net.minecraftforge.fml.network.FMLPlayMessages.SpawnEntity, World, T> customClientFactory;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<EntityType<?>> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, net.minecraft.tags.EntityTypeTags::getGeneration, net.minecraft.tags.EntityTypeTags::func_219762_a);
+
private static <T extends Entity> EntityType<T> func_200712_a(String p_200712_0_, EntityType.Builder<T> p_200712_1_) {
return Registry.func_218325_a(Registry.field_212629_r, p_200712_0_, p_200712_1_.func_206830_a(p_200712_0_));
}
@@ -266,7 +271,7 @@
@@ -266,7 +272,7 @@
return Registry.field_212629_r.func_218349_b(ResourceLocation.func_208304_a(p_220327_0_));
}
@@ -30,7 +31,7 @@
this.field_200732_aK = p_i50385_1_;
this.field_220355_ba = p_i50385_2_;
this.field_200733_aL = p_i50385_3_;
@@ -274,6 +279,10 @@
@@ -274,6 +280,10 @@
this.field_220357_bd = p_i50385_5_;
this.field_206832_aX = p_i50385_6_;
this.field_220359_bi = p_i50385_7_;
@@ -41,7 +42,7 @@
}
@Nullable
@@ -284,6 +293,7 @@
@@ -284,6 +294,7 @@
@Nullable
public T func_220342_a(World p_220342_1_, @Nullable CompoundNBT p_220342_2_, @Nullable ITextComponent p_220342_3_, @Nullable PlayerEntity p_220342_4_, BlockPos p_220342_5_, SpawnReason p_220342_6_, boolean p_220342_7_, boolean p_220342_8_) {
T t = this.func_220349_b(p_220342_1_, p_220342_2_, p_220342_3_, p_220342_4_, p_220342_5_, p_220342_6_, p_220342_7_, p_220342_8_);
@@ -49,7 +50,7 @@
p_220342_1_.func_217376_c(t);
return t;
}
@@ -462,6 +472,9 @@
@@ -462,6 +473,9 @@
}
public int func_220345_k() {
@@ -59,7 +60,7 @@
if (this == field_200729_aH) {
return 32;
} else if (this == field_200801_o) {
@@ -474,6 +487,9 @@
@@ -474,6 +488,9 @@
}
public int func_220332_l() {
@@ -69,7 +70,7 @@
if (this != field_200729_aH && this != field_200805_s) {
if (this == field_200808_v) {
return 4;
@@ -494,6 +510,9 @@
@@ -494,6 +511,9 @@
}
public boolean func_220340_m() {
@@ -79,7 +80,7 @@
return this != field_200729_aH && this != field_200770_J && this != field_200760_az && this != field_200791_e && this != field_200766_F && this != field_200768_H && this != field_200782_V && this != field_200801_o && this != field_200805_s;
}
@@ -501,12 +520,22 @@
@@ -501,12 +521,30 @@
return p_220341_1_.func_199685_a_(this);
}
@@ -87,6 +88,14 @@
+ if (customClientFactory == null) throw new RuntimeException("Missing custom spawn data for entity type "+this);
+ return customClientFactory.apply(packet, world);
+ }
+
+ /**
+ * Retrieves a list of tags names this is known to be associated with.
+ * This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes.
+ */
+ public java.util.Set<ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
public static class Builder<T extends Entity> {
private final EntityType.IFactory<T> field_200709_a;
@@ -102,7 +111,7 @@
private EntitySize field_220326_f = EntitySize.func_220314_b(0.6F, 1.8F);
private Builder(EntityType.IFactory<T> p_i50479_1_, EntityClassification p_i50479_2_) {
@@ -544,12 +573,32 @@
@@ -544,12 +582,32 @@
return this;
}
@@ -136,7 +145,7 @@
if (SharedConstants.field_206244_b) {
throw illegalstateexception;
}
@@ -558,7 +607,7 @@
@@ -558,7 +616,7 @@
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/LivingEntity.java
+++ b/net/minecraft/entity/LivingEntity.java
@@ -104,6 +104,8 @@
@@ -105,6 +105,8 @@
public abstract class LivingEntity extends Entity {
private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
private static final AttributeModifier field_110157_c = (new AttributeModifier(field_110156_b, "Sprinting speed boost", (double)0.3F, AttributeModifier.Operation.MULTIPLY_TOTAL)).func_111168_a(false);
@@ -9,7 +9,7 @@
protected static final DataParameter<Byte> field_184621_as = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187191_a);
private static final DataParameter<Float> field_184632_c = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187193_c);
private static final DataParameter<Integer> field_184633_f = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187192_b);
@@ -227,6 +229,8 @@
@@ -228,6 +230,8 @@
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111263_d);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188791_g);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_189429_h);
@@ -18,7 +18,7 @@
}
protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, BlockState p_184231_4_, BlockPos p_184231_5_) {
@@ -236,9 +240,10 @@
@@ -237,9 +241,10 @@
if (!this.field_70170_p.field_72995_K && this.field_70143_R > 3.0F && p_184231_3_) {
float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F);
@@ -30,7 +30,7 @@
((ServerWorld)this.field_70170_p).func_195598_a(new BlockParticleData(ParticleTypes.field_197611_d, p_184231_4_), this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, (double)0.15F);
}
}
@@ -302,7 +307,7 @@
@@ -303,7 +308,7 @@
}
}
@@ -39,15 +39,15 @@
this.func_184210_p();
}
} else if (this.func_70086_ai() < this.func_205010_bg()) {
@@ -387,6 +392,7 @@
if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot"))) {
@@ -388,6 +393,7 @@
if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e))) {
int i = this.func_70693_a(this.field_70717_bb);
+ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.field_70717_bb, i);
while(i > 0) {
int j = ExperienceOrbEntity.func_70527_a(i);
i -= j;
@@ -589,7 +595,7 @@
@@ -590,7 +596,7 @@
Effect effect = iterator.next();
EffectInstance effectinstance = this.field_70713_bf.get(effect);
if (!effectinstance.func_76455_a(this)) {
@@ -56,7 +56,7 @@
iterator.remove();
this.func_70688_c(effectinstance);
}
@@ -639,8 +645,10 @@
@@ -640,8 +646,10 @@
this.func_82142_c(false);
} else {
Collection<EffectInstance> collection = this.field_70713_bf.values();
@@ -69,7 +69,7 @@
this.func_82142_c(this.func_70644_a(Effects.field_76441_p));
}
@@ -704,7 +712,10 @@
@@ -705,7 +713,10 @@
boolean flag;
for(flag = false; iterator.hasNext(); flag = true) {
@@ -81,7 +81,7 @@
iterator.remove();
}
@@ -734,6 +745,7 @@
@@ -735,6 +746,7 @@
return false;
} else {
EffectInstance effectinstance = this.field_70713_bf.get(p_195064_1_.func_188419_a());
@@ -89,17 +89,17 @@
if (effectinstance == null) {
this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_);
this.func_70670_a(p_195064_1_);
@@ -748,6 +760,9 @@
@@ -749,6 +761,9 @@
}
public boolean func_70687_e(EffectInstance p_70687_1_) {
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ if (event.getResult() != net.minecraftforge.eventbus.api.Event.Result.DEFAULT) return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW;
if (this.func_70668_bt() == CreatureAttribute.UNDEAD) {
if (this.func_70668_bt() == CreatureAttribute.field_223223_b_) {
Effect effect = p_70687_1_.func_188419_a();
if (effect == Effects.field_76428_l || effect == Effects.field_76436_u) {
@@ -768,6 +783,7 @@
@@ -769,6 +784,7 @@
}
public boolean func_195063_d(Effect p_195063_1_) {
@@ -107,7 +107,7 @@
EffectInstance effectinstance = this.func_184596_c(p_195063_1_);
if (effectinstance != null) {
this.func_70688_c(effectinstance);
@@ -804,6 +820,8 @@
@@ -805,6 +821,8 @@
}
public void func_70691_i(float p_70691_1_) {
@@ -116,7 +116,7 @@
float f = this.func_110143_aJ();
if (f > 0.0F) {
this.func_70606_j(f + p_70691_1_);
@@ -820,6 +838,7 @@
@@ -821,6 +839,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -124,7 +124,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_70170_p.field_72995_K) {
@@ -886,8 +905,8 @@
@@ -887,8 +906,8 @@
if (entity1 instanceof PlayerEntity) {
this.field_70718_bc = 100;
this.field_70717_bb = (PlayerEntity)entity1;
@@ -135,7 +135,7 @@
if (wolfentity.func_70909_n()) {
this.field_70718_bc = 100;
LivingEntity livingentity = wolfentity.func_70902_q();
@@ -1069,6 +1088,7 @@
@@ -1070,6 +1089,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
@@ -143,7 +143,16 @@
if (!this.field_70729_aU) {
Entity entity = p_70645_1_.func_76346_g();
LivingEntity livingentity = this.func_94060_bK();
@@ -1113,13 +1133,10 @@
@@ -1091,7 +1111,7 @@
this.func_213345_d(p_70645_1_);
boolean flag = false;
if (livingentity instanceof WitherEntity) {
- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v);
BlockState blockstate = Blocks.field_222388_bz.func_176223_P();
if (this.field_70170_p.func_180495_p(blockpos).func_196958_f() && blockstate.func_196955_c(this.field_70170_p, blockpos)) {
@@ -1114,13 +1134,10 @@
protected void func_213345_d(DamageSource p_213345_1_) {
Entity entity = p_213345_1_.func_76346_g();
@@ -158,9 +167,9 @@
+ this.captureDrops(new java.util.ArrayList<>());
+
boolean flag = this.field_70718_bc > 0;
if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) {
if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e)) {
this.func_213354_a(p_213345_1_, flag);
@@ -1127,6 +1144,10 @@
@@ -1128,6 +1145,10 @@
}
this.func_213337_cE();
@@ -171,7 +180,7 @@
}
protected void func_213337_cE() {
@@ -1156,6 +1177,9 @@
@@ -1157,6 +1178,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@@ -181,7 +190,7 @@
if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) {
this.field_70160_al = true;
Vec3d vec3d = this.func_213322_ci();
@@ -1191,12 +1215,7 @@
@@ -1192,12 +1216,7 @@
return false;
} else {
BlockState blockstate = this.func_213339_cH();
@@ -195,7 +204,7 @@
}
}
@@ -1220,6 +1239,9 @@
@@ -1221,6 +1240,9 @@
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@@ -205,7 +214,7 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
EffectInstance effectinstance = this.func_70660_b(Effects.field_76430_j);
float f = effectinstance == null ? 0.0F : (float)(effectinstance.func_76458_c() + 1);
@@ -1232,7 +1254,7 @@
@@ -1233,7 +1255,7 @@
int l = MathHelper.func_76128_c(this.field_70161_v);
BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l));
if (!blockstate.func_196958_f()) {
@@ -214,7 +223,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
}
@@ -1301,6 +1323,8 @@
@@ -1302,6 +1324,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -223,7 +232,7 @@
p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_);
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
float f = p_70665_2_;
@@ -1311,10 +1335,11 @@
@@ -1312,10 +1336,11 @@
((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f1 * 10.0F));
}
@@ -236,7 +245,7 @@
this.func_110149_m(this.func_110139_bj() - p_70665_2_);
}
}
@@ -1356,6 +1381,8 @@
@@ -1357,6 +1382,8 @@
}
public void func_184609_a(Hand p_184609_1_) {
@@ -245,7 +254,7 @@
if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) {
this.field_110158_av = -1;
this.field_82175_bq = true;
@@ -1714,15 +1741,16 @@
@@ -1715,15 +1742,16 @@
}
this.field_70160_al = true;
@@ -264,7 +273,7 @@
}
protected float func_189749_co() {
@@ -1785,7 +1813,7 @@
@@ -1786,7 +1814,7 @@
}
} else {
BlockPos blockpos = new BlockPos(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v);
@@ -273,7 +282,7 @@
float f7 = this.field_70122_E ? f5 * 0.91F : 0.91F;
this.func_213309_a(this.func_213335_r(f5), p_213352_1_);
this.func_213317_d(this.func_213362_f(this.func_213322_ci()));
@@ -1847,6 +1875,7 @@
@@ -1848,6 +1876,7 @@
f = 0.96F;
}
@@ -281,7 +290,7 @@
this.func_213309_a(f1, p_213352_1_);
this.func_213315_a(MoverType.SELF, this.func_213322_ci());
Vec3d vec3d1 = this.func_213322_ci();
@@ -1922,6 +1951,7 @@
@@ -1923,6 +1952,7 @@
}
public void func_70071_h_() {
@@ -289,7 +298,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -1953,7 +1983,9 @@
@@ -1954,7 +1984,9 @@
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@@ -299,7 +308,7 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(equipmentslottype));
}
@@ -2402,13 +2434,22 @@
@@ -2403,13 +2435,22 @@
protected void func_184608_ct() {
if (this.func_184587_cr()) {
@@ -324,7 +333,7 @@
this.func_71036_o();
}
} else {
@@ -2442,8 +2483,10 @@
@@ -2443,8 +2484,10 @@
public void func_184598_c(Hand p_184598_1_) {
ItemStack itemstack = this.func_184586_b(p_184598_1_);
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
@@ -336,7 +345,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_204802_c(1, true);
this.func_204802_c(2, p_184598_1_ == Hand.OFF_HAND);
@@ -2503,6 +2546,9 @@
@@ -2504,6 +2547,9 @@
vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
@@ -346,7 +355,7 @@
this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c);
}
@@ -2511,7 +2557,9 @@
@@ -2512,7 +2558,9 @@
protected void func_71036_o() {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_184584_a(this.field_184627_bm, 16);
@@ -357,7 +366,7 @@
this.func_184602_cy();
}
@@ -2531,6 +2579,7 @@
@@ -2532,6 +2580,7 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -365,7 +374,7 @@
this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv());
if (this.field_184627_bm.func_222122_m()) {
this.func_184608_ct();
@@ -2686,16 +2735,16 @@
@@ -2687,16 +2736,16 @@
private boolean func_213359_p() {
return this.func_213374_dv().map((p_213347_1_) -> {
@@ -386,11 +395,11 @@
BlockPos blockpos = p_213368_1_.func_177984_a();
return new Vec3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D);
});
@@ -2710,8 +2759,13 @@
@@ -2711,8 +2760,13 @@
@Nullable
@OnlyIn(Dist.CLIENT)
public Direction func_213376_dz() {
+// this.func_213374_dv().map(pos->{ // This is apparently an "optimization" by Mojang, so we'll copy their lead here for now
+// this.getBedPosition().map(pos->{ // This is apparently an "optimization" by Mojang, so we'll copy their lead here for now
+// BlockState state = this.world.getBlockState(pos);
+// return !state.isBed(world, pos, this) ? Direction.UP : state.getBedDirection(world, pos);
+// });
@@ -401,7 +410,7 @@
}
public boolean func_70094_T() {
@@ -2778,4 +2832,58 @@
@@ -2779,4 +2833,58 @@
public void func_213334_d(Hand p_213334_1_) {
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/MobEntity.java
+++ b/net/minecraft/entity/MobEntity.java
@@ -174,6 +174,7 @@
@@ -176,6 +176,7 @@
public void func_70624_b(@Nullable LivingEntity p_70624_1_) {
this.field_70696_bz = p_70624_1_;
@@ -8,7 +8,7 @@
}
public boolean func_213358_a(EntityType<?> p_213358_1_) {
@@ -257,7 +258,6 @@
@@ -259,7 +260,6 @@
}
@@ -16,16 +16,16 @@
public void func_70103_a(byte p_70103_1_) {
if (p_70103_1_ == 20) {
this.func_70656_aK();
@@ -456,7 +456,7 @@
@@ -458,7 +458,7 @@
public void func_70636_d() {
super.func_70636_d();
this.field_70170_p.func_217381_Z().func_76320_a("looting");
- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
for(ItemEntity itementity : this.field_70170_p.func_217357_a(ItemEntity.class, this.func_174813_aQ().func_72314_b(1.0D, 0.0D, 1.0D))) {
if (!itementity.field_70128_L && !itementity.func_92059_d().func_190926_b() && !itementity.func_174874_s()) {
this.func_175445_a(itementity);
@@ -546,6 +546,14 @@
@@ -548,6 +548,14 @@
protected void func_70623_bb() {
if (!this.func_104002_bU() && !this.func_213392_I()) {
Entity entity = this.field_70170_p.func_217362_a(this, -1.0D);
@@ -40,7 +40,7 @@
if (entity != null) {
double d0 = entity.func_70068_e(this);
if (d0 > 16384.0D && this.func_213397_c(d0)) {
@@ -784,6 +792,8 @@
@@ -786,6 +794,8 @@
}
public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) {
@@ -49,7 +49,7 @@
Item item = p_184640_0_.func_77973_b();
if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof BlockItem) || !(((BlockItem)item).func_179223_d() instanceof AbstractSkullBlock))) {
if (item instanceof ArmorItem) {
@@ -791,7 +801,7 @@
@@ -793,7 +803,7 @@
} else if (item == Items.field_185160_cR) {
return EquipmentSlotType.CHEST;
} else {
@@ -58,7 +58,7 @@
}
} else {
return EquipmentSlotType.HEAD;
@@ -1171,10 +1181,10 @@
@@ -1173,10 +1183,10 @@
PlayerEntity playerentity = (PlayerEntity)p_70652_1_;
ItemStack itemstack = this.func_184614_ca();
ItemStack itemstack1 = playerentity.func_184587_cr() ? playerentity.func_184607_cu() : ItemStack.field_190927_a;
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java
+++ b/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java
@@ -17,7 +17,7 @@
import net.minecraft.util.math.IPosWrapper;
import net.minecraft.util.registry.Registry;
-public class MemoryModuleType<U> {
+public class MemoryModuleType<U> extends net.minecraftforge.registries.ForgeRegistryEntry<MemoryModuleType<?>> {
public static final MemoryModuleType<Void> field_220940_a = func_223541_a("dummy");
public static final MemoryModuleType<GlobalPos> field_220941_b = func_220937_a("home", Optional.of(GlobalPos::func_218176_a));
public static final MemoryModuleType<GlobalPos> field_220942_c = func_220937_a("job_site", Optional.of(GlobalPos::func_218176_a));
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/schedule/Activity.java
+++ b/net/minecraft/entity/ai/brain/schedule/Activity.java
@@ -2,7 +2,7 @@
import net.minecraft.util.registry.Registry;
-public class Activity {
+public class Activity extends net.minecraftforge.registries.ForgeRegistryEntry<Activity> {
public static final Activity field_221365_a = func_221363_a("core");
public static final Activity field_221366_b = func_221363_a("idle");
public static final Activity field_221367_c = func_221363_a("work");
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/schedule/Schedule.java
+++ b/net/minecraft/entity/ai/brain/schedule/Schedule.java
@@ -8,7 +8,7 @@
import java.util.stream.Collectors;
import net.minecraft.util.registry.Registry;
-public class Schedule {
+public class Schedule extends net.minecraftforge.registries.ForgeRegistryEntry<Schedule> {
public static final Schedule field_221383_a = func_221380_a("empty").func_221402_a(0, Activity.field_221366_b).func_221404_a();
public static final Schedule field_221384_b = func_221380_a("simple").func_221402_a(5000, Activity.field_221367_c).func_221402_a(11000, Activity.field_221369_e).func_221404_a();
public static final Schedule field_221385_c = func_221380_a("villager_baby").func_221402_a(10, Activity.field_221366_b).func_221402_a(3000, Activity.field_221368_d).func_221402_a(6000, Activity.field_221366_b).func_221402_a(10000, Activity.field_221368_d).func_221402_a(12000, Activity.field_221369_e).func_221404_a();
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/brain/sensor/SensorType.java
+++ b/net/minecraft/entity/ai/brain/sensor/SensorType.java
@@ -4,7 +4,7 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
-public class SensorType<U extends Sensor<?>> {
+public class SensorType<U extends Sensor<?>> extends net.minecraftforge.registries.ForgeRegistryEntry<SensorType<?>> {
public static final SensorType<DummySensor> field_220997_a = func_220996_a("dummy", DummySensor::new);
public static final SensorType<NearestLivingEntitiesSensor> field_220998_b = func_220996_a("nearest_living_entities", NearestLivingEntitiesSensor::new);
public static final SensorType<NearestPlayersSensor> field_220999_c = func_220996_a("nearest_players", NearestPlayersSensor::new);
@@ -4,12 +4,12 @@
}
protected boolean func_212832_a_(ServerWorld p_212832_1_, VillagerEntity p_212832_2_) {
- if (!p_212832_1_.func_82736_K().func_82766_b("mobGriefing")) {
- if (!p_212832_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212832_1_, p_212832_2_)) {
return false;
} else if (p_212832_2_.func_213700_eh().func_221130_b() != VillagerProfession.field_221156_f) {
return false;
@@ -106,6 +106,11 @@
@@ -130,6 +130,11 @@
} else if (itemstack.func_77973_b() == Items.field_185163_cU) {
p_212833_1_.func_180501_a(this.field_220422_a, Blocks.field_185773_cZ.func_176223_P(), 3);
flag = true;
@@ -1,11 +1,11 @@
--- a/net/minecraft/entity/ai/goal/BreakBlockGoal.java
+++ b/net/minecraft/entity/ai/goal/BreakBlockGoal.java
@@ -29,7 +29,7 @@
@@ -30,7 +30,7 @@
}
public boolean func_75250_a() {
- if (!this.field_203118_g.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_203118_g.field_70170_p, this.field_203118_g) || !this.field_203118_g.field_70170_p.func_180495_p(this.field_179494_b).canEntityDestroy(this.field_203118_g.field_70170_p, this.field_179494_b, this.field_203118_g) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_203118_g, this.field_179494_b, this.field_203118_g.field_70170_p.func_180495_p(this.field_179494_b))) {
- if (!this.field_203118_g.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_203118_g.field_70170_p, this.field_179494_b, this.field_203118_g)) {
return false;
} else if (this.field_179496_a > 0) {
--this.field_179496_a;
@@ -1,11 +1,11 @@
--- a/net/minecraft/entity/ai/goal/BreakDoorGoal.java
+++ b/net/minecraft/entity/ai/goal/BreakDoorGoal.java
@@ -28,7 +28,7 @@
@@ -29,7 +29,7 @@
public boolean func_75250_a() {
if (!super.func_75250_a()) {
return false;
- } else if (!this.field_75356_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75356_a.field_70170_p, this.field_75356_a) || !this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b).canEntityDestroy(this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_75356_a, this.field_179507_b, this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b))) {
- } else if (!this.field_75356_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ } else if (!net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a)) {
return false;
} else {
return this.func_220696_a(this.field_75356_a.field_70170_p.func_175659_aa()) && !this.func_195922_f();
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/ai/goal/BreedGoal.java
+++ b/net/minecraft/entity/ai/goal/BreedGoal.java
@@ -79,6 +79,17 @@
@@ -80,6 +80,17 @@
protected void func_75388_i() {
AgeableEntity ageableentity = this.field_75390_d.func_90011_a(this.field_75391_e);
@@ -1,19 +1,19 @@
--- a/net/minecraft/entity/ai/goal/EatGrassGoal.java
+++ b/net/minecraft/entity/ai/goal/EatGrassGoal.java
@@ -58,7 +58,7 @@
@@ -59,7 +59,7 @@
if (this.field_151502_a == 4) {
BlockPos blockpos = new BlockPos(this.field_151500_b);
if (field_179505_b.test(this.field_151501_c.func_180495_p(blockpos))) {
- if (this.field_151501_c.func_82736_K().func_82766_b("mobGriefing")) {
- if (this.field_151501_c.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b)) {
this.field_151501_c.func_175655_b(blockpos, false);
}
@@ -66,7 +66,7 @@
@@ -67,7 +67,7 @@
} else {
BlockPos blockpos1 = blockpos.func_177977_b();
if (this.field_151501_c.func_180495_p(blockpos1).func_177230_c() == Blocks.field_196658_i) {
- if (this.field_151501_c.func_82736_K().func_82766_b("mobGriefing")) {
- if (this.field_151501_c.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b)) {
this.field_151501_c.func_217379_c(2001, blockpos1, Block.func_196246_j(Blocks.field_196658_i.func_176223_P()));
this.field_151501_c.func_180501_a(blockpos1, Blocks.field_150346_d.func_176223_P(), 2);
@@ -1,24 +1,24 @@
--- a/net/minecraft/entity/boss/WitherEntity.java
+++ b/net/minecraft/entity/boss/WitherEntity.java
@@ -206,7 +206,7 @@
@@ -207,7 +207,7 @@
if (this.func_82212_n() > 0) {
int j1 = this.func_82212_n() - 1;
if (j1 <= 0) {
- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing") ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
+ Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
this.field_70170_p.func_217398_a(this, this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v, 7.0F, false, explosion$mode);
this.field_70170_p.func_175669_a(1023, new BlockPos(this), 0);
}
@@ -281,7 +281,7 @@
@@ -282,7 +282,7 @@
if (this.field_82222_j > 0) {
--this.field_82222_j;
- if (this.field_82222_j == 0 && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- if (this.field_82222_j == 0 && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (this.field_82222_j == 0 && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
int i1 = MathHelper.func_76128_c(this.field_70163_u);
int l1 = MathHelper.func_76128_c(this.field_70165_t);
int i2 = MathHelper.func_76128_c(this.field_70161_v);
@@ -295,7 +295,7 @@
@@ -296,7 +296,7 @@
int l = i2 + l2;
BlockPos blockpos = new BlockPos(i3, k, l);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -27,7 +27,7 @@
flag = this.field_70170_p.func_175655_b(blockpos, true) || flag;
}
}
@@ -316,6 +316,7 @@
@@ -317,6 +317,7 @@
}
}
@@ -1,15 +1,13 @@
--- a/net/minecraft/entity/boss/dragon/EnderDragonEntity.java
+++ b/net/minecraft/entity/boss/dragon/EnderDragonEntity.java
@@ -407,8 +407,10 @@
@@ -408,8 +408,8 @@
BlockPos blockpos = new BlockPos(k1, l1, i2);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
Block block = blockstate.func_177230_c();
- if (!blockstate.func_196958_f() && blockstate.func_185904_a() != Material.field_151581_o) {
- if (this.field_70170_p.func_82736_K().func_82766_b("mobGriefing") && !BlockTags.field_219754_W.func_199685_a_(block)) {
- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) && !BlockTags.field_219754_W.func_199685_a_(block)) {
+ if (!blockstate.isAir(this.field_70170_p, blockpos) && blockstate.func_185904_a() != Material.field_151581_o) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this) &&
+ blockstate.canEntityDestroy(this.field_70170_p, blockpos, this) &&
+ net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, blockstate)) {
+ if (net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_70170_p, blockpos, this) && !BlockTags.field_219754_W.func_199685_a_(block)) {
flag1 = this.field_70170_p.func_217377_a(blockpos, false) || flag1;
} else {
flag = true;
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/effect/LightningBoltEntity.java
+++ b/net/minecraft/entity/effect/LightningBoltEntity.java
@@ -79,6 +79,7 @@
@@ -80,6 +80,7 @@
List<Entity> list = this.field_70170_p.func_175674_a(this, new AxisAlignedBB(this.field_70165_t - 3.0D, this.field_70163_u - 3.0D, this.field_70161_v - 3.0D, this.field_70165_t + 3.0D, this.field_70163_u + 6.0D + 3.0D, this.field_70161_v + 3.0D), Entity::func_70089_S);
for(Entity entity : list) {
@@ -1,15 +1,15 @@
--- a/net/minecraft/entity/item/BoatEntity.java
+++ b/net/minecraft/entity/item/BoatEntity.java
@@ -458,7 +458,7 @@
@@ -459,7 +459,7 @@
blockpos$pooledmutableblockpos.func_181079_c(l1, k2, i2);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos);
if (!(blockstate.func_177230_c() instanceof LilyPadBlock) && VoxelShapes.func_197879_c(blockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutableblockpos).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.AND)) {
if (!(blockstate.func_177230_c() instanceof LilyPadBlock) && VoxelShapes.func_197879_c(blockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutableblockpos).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.field_223238_i_)) {
- f += blockstate.func_177230_c().func_208618_m();
+ f += blockstate.getSlipperiness(this.field_70170_p, blockpos$pooledmutableblockpos, this);
++k1;
}
}
@@ -777,6 +777,20 @@
@@ -778,6 +778,20 @@
return new SSpawnObjectPacket(this);
}
@@ -1,15 +1,15 @@
--- a/net/minecraft/entity/item/EnderPearlEntity.java
+++ b/net/minecraft/entity/item/EnderPearlEntity.java
@@ -84,6 +84,8 @@
if (!this.field_70170_p.field_72995_K) {
if (livingentity instanceof ServerPlayerEntity) {
ServerPlayerEntity serverplayerentity = (ServerPlayerEntity)livingentity;
if (serverplayerentity.field_71135_a.func_147362_b().func_150724_d() && serverplayerentity.field_70170_p == this.field_70170_p && !serverplayerentity.func_70608_bn()) {
+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(serverplayerentity, this.field_70165_t, this.field_70163_u, this.field_70161_v, 5.0F);
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { // Don't indent to lower patch size
if (this.field_70146_Z.nextFloat() < 0.05F && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) {
if (serverplayerentity.field_71135_a.func_147362_b().func_150724_d() && serverplayerentity.field_70170_p == this.field_70170_p && !serverplayerentity.func_70608_bn()) {
if (this.field_70146_Z.nextFloat() < 0.05F && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) {
EndermiteEntity endermiteentity = EntityType.field_200804_r.func_200721_a(this.field_70170_p);
endermiteentity.func_175496_a(true);
@@ -95,9 +97,10 @@
@@ -96,9 +98,10 @@
livingentity.func_184210_p();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/FallingBlockEntity.java
+++ b/net/minecraft/entity/item/FallingBlockEntity.java
@@ -152,7 +152,7 @@
@@ -153,7 +153,7 @@
((FallingBlock)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, blockstate);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/HangingEntity.java
+++ b/net/minecraft/entity/item/HangingEntity.java
@@ -119,6 +119,8 @@
@@ -118,6 +118,8 @@
int j1 = (j - 1) / -2;
blockpos$mutableblockpos.func_189533_g(blockpos).func_189534_c(direction, k + i1).func_189534_c(Direction.UP, l + j1);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos$mutableblockpos);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/ItemFrameEntity.java
+++ b/net/minecraft/entity/item/ItemFrameEntity.java
@@ -190,7 +190,7 @@
@@ -191,7 +191,7 @@
}
private void func_110131_b(ItemStack p_110131_1_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/item/PaintingType.java
+++ b/net/minecraft/entity/item/PaintingType.java
@@ -2,7 +2,7 @@
import net.minecraft.util.registry.Registry;
-public class PaintingType {
+public class PaintingType extends net.minecraftforge.registries.ForgeRegistryEntry<PaintingType> {
public static final PaintingType field_200843_b = func_221119_a("kebab", 16, 16);
public static final PaintingType field_200844_c = func_221119_a("aztec", 16, 16);
public static final PaintingType field_200845_d = func_221119_a("alban", 16, 16);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java
+++ b/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java
@@ -34,7 +34,7 @@
@@ -35,7 +35,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -9,7 +9,7 @@
private static final DataParameter<Integer> field_184265_a = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187192_b);
private static final DataParameter<Integer> field_184266_b = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187192_b);
private static final DataParameter<Float> field_184267_c = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187193_c);
@@ -55,6 +55,7 @@
@@ -56,6 +56,7 @@
private double field_70507_ar;
@OnlyIn(Dist.CLIENT)
private double field_70506_as;
@@ -17,7 +17,7 @@
protected AbstractMinecartEntity(EntityType<?> p_i48538_1_, World p_i48538_2_) {
super(p_i48538_1_, p_i48538_2_);
@@ -101,11 +102,12 @@
@@ -102,11 +103,12 @@
@Nullable
public AxisAlignedBB func_70114_g(Entity p_70114_1_) {
@@ -31,7 +31,7 @@
}
public double func_70042_X() {
@@ -213,7 +215,7 @@
@@ -214,7 +216,7 @@
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -40,7 +40,7 @@
this.func_180460_a(blockpos, blockstate);
if (blockstate.func_177230_c() == Blocks.field_150408_cc) {
this.func_96095_a(i, j, k, blockstate.func_177229_b(PoweredRailBlock.field_176569_M));
@@ -240,8 +242,11 @@
@@ -241,8 +243,11 @@
}
this.func_70101_b(this.field_70177_z, this.field_70125_A);
@@ -54,7 +54,7 @@
if (!list.isEmpty()) {
for(int l = 0; l < list.size(); ++l) {
Entity entity1 = list.get(l);
@@ -253,7 +258,7 @@
@@ -254,7 +259,7 @@
}
}
} else {
@@ -63,7 +63,7 @@
if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof AbstractMinecartEntity) {
entity.func_70108_f(this);
}
@@ -261,6 +266,7 @@
@@ -262,6 +267,7 @@
}
this.func_70072_I();
@@ -71,7 +71,7 @@
}
}
@@ -272,16 +278,24 @@
@@ -273,16 +279,24 @@
}
protected void func_180459_n() {
@@ -98,7 +98,7 @@
}
}
@@ -298,24 +312,24 @@
@@ -299,24 +313,24 @@
flag1 = !flag;
}
@@ -129,7 +129,7 @@
++this.field_70163_u;
}
@@ -344,7 +358,7 @@
@@ -345,7 +359,7 @@
}
}
@@ -138,7 +138,7 @@
double d19 = Math.sqrt(func_213296_b(this.func_213322_ci()));
if (d19 < 0.03D) {
this.func_213317_d(Vec3d.field_186680_a);
@@ -375,10 +389,7 @@
@@ -376,10 +390,7 @@
this.field_70165_t = d20 + d1 * d11;
this.field_70161_v = d7 + d2 * d11;
this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
@@ -150,7 +150,7 @@
if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[0][2]) {
this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v);
} else if (aint[1][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[1][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[1][2]) {
@@ -406,7 +417,10 @@
@@ -407,7 +418,10 @@
this.func_213293_j(d23 * (double)(j - p_180460_1_.func_177958_n()), vec3d5.field_72448_b, d23 * (double)(i - p_180460_1_.func_177952_p()));
}
@@ -162,7 +162,7 @@
Vec3d vec3d6 = this.func_213322_ci();
double d24 = Math.sqrt(func_213296_b(vec3d6));
if (d24 > 0.01D) {
@@ -461,7 +475,7 @@
@@ -462,7 +476,7 @@
BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k));
if (blockstate.func_203425_a(BlockTags.field_203437_y)) {
@@ -171,7 +171,7 @@
p_70495_3_ = (double)j;
if (railshape.func_208092_c()) {
p_70495_3_ = (double)(j + 1);
@@ -498,7 +512,7 @@
@@ -499,7 +513,7 @@
BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k));
if (blockstate.func_203425_a(BlockTags.field_203437_y)) {
@@ -180,7 +180,7 @@
int[][] aint = field_70500_g[railshape.func_208091_a()];
double d0 = (double)i + 0.5D + (double)aint[0][0] * 0.5D;
double d1 = (double)j + 0.0625D + (double)aint[0][1] * 0.5D;
@@ -561,6 +575,11 @@
@@ -562,6 +576,11 @@
}
public void func_70108_f(Entity p_70108_1_) {
@@ -192,7 +192,7 @@
if (!this.field_70170_p.field_72995_K) {
if (!p_70108_1_.field_70145_X && !this.field_70145_X) {
if (!this.func_184196_w(p_70108_1_)) {
@@ -596,11 +615,11 @@
@@ -597,11 +616,11 @@
Vec3d vec3d2 = this.func_213322_ci();
Vec3d vec3d3 = p_70108_1_.func_213322_ci();
@@ -206,7 +206,7 @@
p_70108_1_.func_213317_d(vec3d3.func_216372_d(0.2D, 1.0D, 0.2D));
p_70108_1_.func_70024_g(vec3d2.field_72450_a + d0, 0.0D, vec3d2.field_72449_c + d1);
this.func_213317_d(vec3d2.func_216372_d(0.95D, 1.0D, 0.95D));
@@ -706,6 +725,40 @@
@@ -707,6 +726,40 @@
return new SSpawnObjectPacket(this);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java
+++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java
@@ -115,11 +115,17 @@
@@ -116,11 +116,17 @@
}
public void func_70106_y() {
@@ -19,7 +19,7 @@
}
protected void func_213281_b(CompoundNBT p_213281_1_) {
@@ -148,6 +154,7 @@
@@ -149,6 +155,7 @@
}
public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) {
@@ -27,15 +27,16 @@
p_184230_1_.func_213829_a(this);
return true;
}
@@ -167,6 +174,7 @@
@@ -168,6 +175,8 @@
LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(this.field_184290_c);
this.field_184290_c = null;
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, new BlockPos(this)).func_216016_a(this.field_184291_d);
+ lootcontext$builder.func_216015_a(LootParameters.field_216281_a, this); // Forge: add looted entity to LootContext
+ // Forge: add this entity to loot context, however, currently Vanilla uses 'this' for the player creating the chests. So we take over 'killer_entity' for this.
+ lootcontext$builder.func_216015_a(LootParameters.field_216284_d, this);
if (p_184288_1_ != null) {
lootcontext$builder.func_186469_a(p_184288_1_.func_184817_da()).func_216015_a(LootParameters.field_216281_a, p_184288_1_);
}
@@ -197,4 +205,17 @@
@@ -198,4 +207,17 @@
}
protected abstract Container func_213968_a(int p_213968_1_, PlayerInventory p_213968_2_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java
+++ b/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java
@@ -110,6 +110,7 @@
@@ -111,6 +111,7 @@
}
public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/merchant/villager/VillagerEntity.java
+++ b/net/minecraft/entity/merchant/villager/VillagerEntity.java
@@ -229,7 +229,7 @@
@@ -227,7 +227,7 @@
if (flag) {
itemstack.func_111282_a(p_184645_1_, this, p_184645_2_);
return true;
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/merchant/villager/VillagerProfession.java
+++ b/net/minecraft/entity/merchant/villager/VillagerProfession.java
@@ -9,7 +9,7 @@
import net.minecraft.util.registry.Registry;
import net.minecraft.village.PointOfInterestType;
-public class VillagerProfession {
+public class VillagerProfession extends net.minecraftforge.registries.ForgeRegistryEntry<VillagerProfession> {
public static final VillagerProfession field_221151_a = func_221147_a("none", PointOfInterestType.field_221054_b);
public static final VillagerProfession field_221152_b = func_221147_a("armorer", PointOfInterestType.field_221055_c);
public static final VillagerProfession field_221153_c = func_221147_a("butcher", PointOfInterestType.field_221056_d);
@@ -1,10 +1,10 @@
--- a/net/minecraft/entity/monster/CreeperEntity.java
+++ b/net/minecraft/entity/monster/CreeperEntity.java
@@ -207,7 +207,7 @@
@@ -208,7 +208,7 @@
private void func_146077_cc() {
if (!this.field_70170_p.field_72995_K) {
- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing") ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
+ Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
float f = this.func_70830_n() ? 2.0F : 1.0F;
this.field_70729_aU = true;
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/monster/EndermanEntity.java
+++ b/net/minecraft/entity/monster/EndermanEntity.java
@@ -225,7 +225,9 @@
@@ -226,7 +226,9 @@
if (!this.field_70170_p.func_180495_p(blockpos$mutableblockpos).func_185904_a().func_76230_c()) {
return false;
} else {
@@ -11,16 +11,16 @@
if (flag) {
this.field_70170_p.func_184148_a((PlayerEntity)null, this.field_70169_q, this.field_70167_r, this.field_70166_s, SoundEvents.field_187534_aX, this.func_184176_by(), 1.0F, 1.0F);
this.func_184185_a(SoundEvents.field_187534_aX, 1.0F, 1.0F);
@@ -370,7 +372,7 @@
@@ -371,7 +373,7 @@
public boolean func_75250_a() {
if (this.field_179475_a.func_195405_dq() == null) {
return false;
- } else if (!this.field_179475_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- } else if (!this.field_179475_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179475_a.field_70170_p, this.field_179475_a)) {
return false;
} else {
return this.field_179475_a.func_70681_au().nextInt(2000) == 0;
@@ -388,7 +390,7 @@
@@ -389,7 +391,7 @@
BlockPos blockpos1 = blockpos.func_177977_b();
BlockState blockstate1 = iworld.func_180495_p(blockpos1);
BlockState blockstate2 = this.field_179475_a.func_195405_dq();
@@ -29,11 +29,20 @@
iworld.func_180501_a(blockpos, blockstate2, 3);
this.field_179475_a.func_195406_b((BlockState)null);
}
@@ -433,7 +435,7 @@
@@ -397,7 +399,7 @@
}
private boolean func_220836_a(IWorldReader p_220836_1_, BlockPos p_220836_2_, BlockState p_220836_3_, BlockState p_220836_4_, BlockState p_220836_5_, BlockPos p_220836_6_) {
- return p_220836_4_.func_196958_f() && !p_220836_5_.func_196958_f() && Block.func_208062_a(p_220836_5_.func_196952_d(p_220836_1_, p_220836_6_)) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_);
+ return p_220836_4_.isAir(p_220836_1_, p_220836_2_) && !p_220836_5_.isAir(p_220836_1_, p_220836_6_) && Block.func_208062_a(p_220836_5_.func_196952_d(p_220836_1_, p_220836_6_)) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_);
}
}
@@ -434,7 +436,7 @@
public boolean func_75250_a() {
if (this.field_179473_a.func_195405_dq() != null) {
return false;
- } else if (!this.field_179473_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- } else if (!this.field_179473_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179473_a.field_70170_p, this.field_179473_a)) {
return false;
} else {
@@ -1,10 +1,10 @@
--- a/net/minecraft/entity/monster/EvokerEntity.java
+++ b/net/minecraft/entity/monster/EvokerEntity.java
@@ -286,7 +286,7 @@
@@ -287,7 +287,7 @@
return false;
} else if (EvokerEntity.this.field_70173_aa < this.field_193322_d) {
return false;
- } else if (!EvokerEntity.this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- } else if (!EvokerEntity.this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(EvokerEntity.this.field_70170_p, EvokerEntity.this)) {
return false;
} else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/monster/MagmaCubeEntity.java
+++ b/net/minecraft/entity/monster/MagmaCubeEntity.java
@@ -77,6 +77,7 @@
@@ -79,6 +79,7 @@
Vec3d vec3d = this.func_213322_ci();
this.func_213293_j(vec3d.field_72450_a, (double)(0.42F + (float)this.func_70809_q() * 0.1F), vec3d.field_72449_c);
this.field_70160_al = true;
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/monster/RavagerEntity.java
+++ b/net/minecraft/entity/monster/RavagerEntity.java
@@ -139,7 +139,7 @@
this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(MathHelper.func_219803_d(0.1D, d1, d0));
}
- if (this.field_70123_F && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (this.field_70123_F && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
boolean flag = false;
AxisAlignedBB axisalignedbb = this.func_174813_aQ().func_186662_g(0.2D);
@@ -1,20 +1,20 @@
--- a/net/minecraft/entity/monster/SilverfishEntity.java
+++ b/net/minecraft/entity/monster/SilverfishEntity.java
@@ -141,7 +141,7 @@
@@ -138,7 +138,7 @@
return false;
} else {
Random random = this.field_75457_a.func_70681_au();
- if (this.field_75457_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing") && random.nextInt(10) == 0) {
- if (this.field_75457_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) && random.nextInt(10) == 0) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75457_a.field_70170_p, this.field_75457_a) && random.nextInt(10) == 0) {
this.field_179483_b = Direction.func_176741_a(random);
BlockPos blockpos = (new BlockPos(this.field_75457_a.field_70165_t, this.field_75457_a.field_70163_u + 0.5D, this.field_75457_a.field_70161_v)).func_177972_a(this.field_179483_b);
BlockState blockstate = this.field_75457_a.field_70170_p.func_180495_p(blockpos);
@@ -210,7 +210,7 @@
@@ -207,7 +207,7 @@
BlockState blockstate = world.func_180495_p(blockpos1);
Block block = blockstate.func_177230_c();
if (block instanceof SilverfishBlock) {
- if (world.func_82736_K().func_82766_b("mobGriefing")) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, field_179464_a)) {
- if (world.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, this.field_179464_a)) {
world.func_175655_b(blockpos1, true);
} else {
world.func_180501_a(blockpos1, ((SilverfishBlock)block).func_196468_d().func_176223_P(), 3);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/monster/SlimeEntity.java
+++ b/net/minecraft/entity/monster/SlimeEntity.java
@@ -113,7 +113,7 @@
@@ -114,7 +114,7 @@
public void func_70071_h_() {
if (!this.field_70170_p.field_72995_K && this.field_70170_p.func_175659_aa() == Difficulty.PEACEFUL && this.func_70809_q() > 0) {
@@ -9,7 +9,7 @@
}
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
@@ -122,6 +122,7 @@
@@ -123,6 +123,7 @@
if (this.field_70122_E && !this.field_175452_bi) {
int i = this.func_70809_q();
@@ -18,14 +18,14 @@
float f = this.field_70146_Z.nextFloat() * ((float)Math.PI * 2F);
float f1 = this.field_70146_Z.nextFloat() * 0.5F + 0.5F;
@@ -251,7 +252,7 @@
}
public boolean func_213380_a(IWorld p_213380_1_, SpawnReason p_213380_2_) {
BlockPos blockpos = new BlockPos(this.field_70165_t, 0.0D, this.field_70161_v);
- if (p_213380_1_.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1) {
+ if (p_213380_1_.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p)) {
public static boolean func_223366_c(EntityType<SlimeEntity> p_223366_0_, IWorld p_223366_1_, SpawnReason p_223366_2_, BlockPos p_223366_3_, Random p_223366_4_) {
- if (p_223366_1_.func_72912_H().func_76067_t() == WorldType.field_77138_c && p_223366_4_.nextInt(4) != 1) {
+ if (p_223366_1_.func_72912_H().func_76067_t().handleSlimeSpawnReduction(p_223366_4_, p_223366_1_) && p_223366_4_.nextInt(4) != 1) {
return false;
} else {
if (p_213380_1_.func_175659_aa() != Difficulty.PEACEFUL) {
if (p_223366_1_.func_175659_aa() != Difficulty.PEACEFUL) {
@@ -309,6 +310,12 @@
return super.func_213305_a(p_213305_1_).func_220313_a(0.255F * (float)this.func_70809_q());
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/monster/ZombieEntity.java
+++ b/net/minecraft/entity/monster/ZombieEntity.java
@@ -105,7 +105,7 @@
@@ -106,7 +106,7 @@
this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.23F);
this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D);
this.func_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(2.0D);
@@ -9,11 +9,11 @@
}
protected void func_70088_a() {
@@ -278,12 +278,16 @@
@@ -279,12 +279,16 @@
livingentity = (LivingEntity)p_70097_1_.func_76346_g();
}
- if (livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) {
- if (livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) {
int i = MathHelper.func_76128_c(this.field_70165_t);
int j = MathHelper.func_76128_c(this.field_70163_u);
int k = MathHelper.func_76128_c(this.field_70161_v);
@@ -22,13 +22,13 @@
+ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent event = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, livingentity, this.func_110148_a(field_110186_bp).func_111126_e());
+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return true;
+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ||
+ livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) {
+ ZombieEntity zombieentity = event.getCustomSummonedAid() != null && event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ? event.getCustomSummonedAid() : new ZombieEntity(this.field_70170_p);
+ livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
+ ZombieEntity zombieentity = event.getCustomSummonedAid() != null && event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ? event.getCustomSummonedAid() : EntityType.field_200725_aD.func_200721_a(this.field_70170_p);
+
for(int l = 0; l < 50; ++l) {
int i1 = i + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
int j1 = j + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
@@ -293,6 +297,7 @@
@@ -294,6 +298,7 @@
zombieentity.func_70107_b((double)i1, (double)j1, (double)k1);
if (!this.field_70170_p.func_217358_a((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_217346_i(zombieentity) && this.field_70170_p.func_217345_j(zombieentity) && !this.field_70170_p.func_72953_d(zombieentity.func_174813_aQ())) {
this.field_70170_p.func_217376_c(zombieentity);
@@ -36,7 +36,7 @@
zombieentity.func_70624_b(livingentity);
zombieentity.func_213386_a(this.field_70170_p, this.field_70170_p.func_175649_E(new BlockPos(zombieentity)), SpawnReason.REINFORCEMENT, (ILivingEntityData)null, (CompoundNBT)null);
this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, AttributeModifier.Operation.ADDITION));
@@ -425,7 +430,7 @@
@@ -426,7 +431,7 @@
float f = p_213386_2_.func_180170_c();
this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * f);
if (p_213386_4_ == null) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/passive/FoxEntity.java
+++ b/net/minecraft/entity/passive/FoxEntity.java
@@ -767,7 +767,7 @@
}
protected void func_220730_m() {
- if (FoxEntity.this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(FoxEntity.this.field_70170_p, FoxEntity.this)) {
BlockState blockstate = FoxEntity.this.field_70170_p.func_180495_p(this.field_179494_b);
if (blockstate.func_177230_c() == Blocks.field_222434_lW) {
int i = blockstate.func_177229_b(SweetBerryBushBlock.field_220125_a);
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/passive/MooshroomEntity.java
+++ b/net/minecraft/entity/passive/MooshroomEntity.java
@@ -28,7 +28,7 @@
@@ -33,7 +33,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
import org.apache.commons.lang3.tuple.Pair;
@@ -9,7 +9,7 @@
private static final DataParameter<String> field_213449_bz = EntityDataManager.func_187226_a(MooshroomEntity.class, DataSerializers.field_187194_d);
private Effect field_213450_bA;
private int field_213447_bB;
@@ -85,7 +85,7 @@
@@ -97,7 +97,7 @@
this.func_184185_a(soundevent, 1.0F, 1.0F);
return true;
@@ -18,7 +18,7 @@
this.field_70170_p.func_195594_a(ParticleTypes.field_197627_t, this.field_70165_t, this.field_70163_u + (double)(this.func_213302_cg() / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D);
if (!this.field_70170_p.field_72995_K) {
this.func_70106_y();
@@ -191,6 +191,33 @@
@@ -203,6 +203,33 @@
return mooshroomentity$type2;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/passive/OcelotEntity.java
+++ b/net/minecraft/entity/passive/OcelotEntity.java
@@ -153,7 +153,7 @@
@@ -154,7 +154,7 @@
if ((this.field_70914_e == null || this.field_70914_e.func_75277_f()) && !this.func_213530_dX() && this.func_70877_b(itemstack) && p_184645_1_.func_70068_e(this) < 9.0D) {
this.func_175505_a(p_184645_1_, itemstack);
if (!this.field_70170_p.field_72995_K) {
@@ -9,12 +9,3 @@
this.func_193101_c(p_184645_1_);
this.func_70908_e(true);
this.field_70170_p.func_72960_a(this, (byte)7);
@@ -266,7 +266,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
Block block = p_213380_1_.func_180495_p(blockpos.func_177977_b()).func_177230_c();
- return block.func_203417_a(BlockTags.field_206952_E) || block == Blocks.field_196658_i || block instanceof LogBlock || block == Blocks.field_150350_a && super.func_213380_a(p_213380_1_, p_213380_2_);
+ return block.func_203417_a(BlockTags.field_206952_E) || block == Blocks.field_196658_i || block instanceof LogBlock || block == Blocks.field_150350_a && super.func_213380_a(p_213380_1_, p_213380_2_); //Forge: GRASS -> GRASS_BLOCK
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@@ -1,19 +1,10 @@
--- a/net/minecraft/entity/passive/RabbitEntity.java
+++ b/net/minecraft/entity/passive/RabbitEntity.java
@@ -362,7 +362,7 @@
int k = MathHelper.func_76128_c(this.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
Block block = p_213380_1_.func_180495_p(blockpos.func_177977_b()).func_177230_c();
- return block != Blocks.field_150349_c && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_213380_a(p_213380_1_, p_213380_2_) : true;
+ return block != Blocks.field_196658_i && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_213380_a(p_213380_1_, p_213380_2_) : true; //Forge: GRASS -> GRASS_BLOCk
}
private boolean func_175534_cv() {
@@ -500,7 +500,7 @@
@@ -502,7 +502,7 @@
public boolean func_75250_a() {
if (this.field_179496_a <= 0) {
- if (!this.field_179500_c.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- if (!this.field_179500_c.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179500_c.field_70170_p, this.field_179500_c)) {
return false;
}
@@ -1,7 +1,7 @@
--- a/net/minecraft/entity/passive/SnowGolemEntity.java
+++ b/net/minecraft/entity/passive/SnowGolemEntity.java
@@ -32,7 +32,7 @@
import net.minecraft.util.math.MathHelper;
@@ -33,7 +33,7 @@
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
-public class SnowGolemEntity extends GolemEntity implements IRangedAttackMob {
@@ -9,16 +9,16 @@
private static final DataParameter<Byte> field_184749_a = EntityDataManager.func_187226_a(SnowGolemEntity.class, DataSerializers.field_187191_a);
public SnowGolemEntity(EntityType<? extends SnowGolemEntity> p_i50244_1_, World p_i50244_2_) {
@@ -87,7 +87,7 @@
@@ -88,7 +88,7 @@
this.func_70097_a(DamageSource.field_76370_b, 1.0F);
}
- if (!this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- if (!this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
return;
}
@@ -98,7 +98,7 @@
@@ -99,7 +99,7 @@
j = MathHelper.func_76128_c(this.field_70163_u);
k = MathHelper.func_76128_c(this.field_70161_v + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F));
BlockPos blockpos = new BlockPos(i, j, k);
@@ -27,7 +27,7 @@
this.field_70170_p.func_175656_a(blockpos, blockstate);
}
}
@@ -124,7 +124,7 @@
@@ -125,7 +125,7 @@
protected boolean func_184645_a(PlayerEntity p_184645_1_, Hand p_184645_2_) {
ItemStack itemstack = p_184645_1_.func_184586_b(p_184645_2_);
@@ -36,7 +36,7 @@
this.func_184747_a(false);
itemstack.func_222118_a(1, p_184645_1_, (p_213622_1_) -> {
p_213622_1_.func_213334_d(p_184645_2_);
@@ -162,4 +162,15 @@
@@ -163,4 +163,15 @@
protected SoundEvent func_184615_bR() {
return SoundEvents.field_187801_fC;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/player/PlayerEntity.java
+++ b/net/minecraft/entity/player/PlayerEntity.java
@@ -107,6 +107,10 @@
@@ -108,6 +108,10 @@
import net.minecraftforge.api.distmarker.OnlyIn;
public abstract class PlayerEntity extends LivingEntity {
@@ -11,17 +11,17 @@
public static final EntitySize field_213835_bs = EntitySize.func_220314_b(0.6F, 1.8F);
private static final Map<Pose, EntitySize> field_213836_b = ImmutableMap.<Pose, EntitySize>builder().put(Pose.STANDING, field_213835_bs).put(Pose.SLEEPING, field_213377_as).put(Pose.FALL_FLYING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SWIMMING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SPIN_ATTACK, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SNEAKING, EntitySize.func_220314_b(0.6F, 1.5F)).put(Pose.DYING, EntitySize.func_220311_c(0.2F, 0.2F)).build();
private static final DataParameter<Float> field_184829_a = EntityDataManager.func_187226_a(PlayerEntity.class, DataSerializers.field_187193_c);
@@ -148,6 +152,9 @@
@@ -149,6 +153,9 @@
private final CooldownTracker field_184832_bU = this.func_184815_l();
@Nullable
public FishingBobberEntity field_71104_cf;
+ private net.minecraft.world.dimension.DimensionType spawnDimension = net.minecraft.world.dimension.DimensionType.OVERWORLD;
+ private net.minecraft.world.dimension.DimensionType spawnDimension = net.minecraft.world.dimension.DimensionType.field_223227_a_;
+ private final java.util.Collection<ITextComponent> prefixes = new java.util.LinkedList<ITextComponent>();
+ private final java.util.Collection<ITextComponent> suffixes = new java.util.LinkedList<ITextComponent>();
public PlayerEntity(World p_i45324_1_, GameProfile p_i45324_2_) {
super(EntityType.field_200729_aH, p_i45324_1_);
@@ -166,6 +173,7 @@
@@ -167,6 +174,7 @@
this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.1F);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188790_f);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188792_h);
@@ -29,7 +29,7 @@
}
protected void func_70088_a() {
@@ -179,6 +187,7 @@
@@ -180,6 +188,7 @@
}
public void func_70071_h_() {
@@ -37,7 +37,7 @@
this.field_70145_X = this.func_175149_v();
if (this.func_175149_v()) {
this.field_70122_E = false;
@@ -194,7 +203,7 @@
@@ -195,7 +204,7 @@
this.field_71076_b = 100;
}
@@ -46,7 +46,7 @@
this.func_70999_a(false, true, true);
}
} else if (this.field_71076_b > 0) {
@@ -252,6 +261,7 @@
@@ -253,6 +262,7 @@
this.func_203041_m();
this.field_184832_bU.func_185144_a();
this.func_213832_dB();
@@ -54,7 +54,7 @@
}
protected boolean func_204229_de() {
@@ -260,6 +270,7 @@
@@ -261,6 +271,7 @@
}
private void func_203041_m() {
@@ -62,7 +62,7 @@
ItemStack itemstack = this.func_184582_a(EquipmentSlotType.HEAD);
if (itemstack.func_77973_b() == Items.field_203179_ao && !this.func_208600_a(FluidTags.field_206959_a)) {
this.func_195064_c(new EffectInstance(Effects.field_76427_o, 200, 0, false, false, true));
@@ -426,10 +437,10 @@
@@ -427,10 +438,10 @@
this.field_71107_bF = this.field_71109_bG;
this.field_71109_bG = 0.0F;
this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2);
@@ -75,7 +75,7 @@
}
}
@@ -542,6 +553,7 @@
@@ -543,6 +554,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
@@ -83,7 +83,7 @@
super.func_70645_a(p_70645_1_);
this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
if (!this.func_175149_v()) {
@@ -596,12 +608,14 @@
@@ -597,12 +609,14 @@
@Nullable
public ItemEntity func_71040_bB(boolean p_71040_1_) {
@@ -100,7 +100,7 @@
}
@Nullable
@@ -635,7 +649,12 @@
@@ -636,7 +650,12 @@
}
}
@@ -113,7 +113,7 @@
float f = this.field_71071_by.func_184438_a(p_184813_1_);
if (f > 1.0F) {
int i = EnchantmentHelper.func_185293_e(this);
@@ -677,11 +696,12 @@
@@ -678,11 +697,12 @@
f /= 5.0F;
}
@@ -127,7 +127,7 @@
}
public void func_70037_a(CompoundNBT p_70037_1_) {
@@ -705,6 +725,17 @@
@@ -706,6 +726,17 @@
this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced");
}
@@ -140,12 +140,12 @@
+ net.minecraft.world.dimension.DimensionType spawnDim = null;
+ if (p_70037_1_.func_150297_b("SpawnDimension", net.minecraftforge.common.util.Constants.NBT.TAG_STRING))
+ spawnDim = net.minecraft.world.dimension.DimensionType.func_193417_a(new ResourceLocation(p_70037_1_.func_74779_i("SpawnDimension")));
+ this.spawnDimension = spawnDim != null ? spawnDim : net.minecraft.world.dimension.DimensionType.OVERWORLD;
+ this.spawnDimension = spawnDim != null ? spawnDim : net.minecraft.world.dimension.DimensionType.field_223227_a_;
+
this.field_71100_bB.func_75112_a(p_70037_1_);
this.field_71075_bZ.func_75095_b(p_70037_1_);
if (p_70037_1_.func_150297_b("EnderItems", 9)) {
@@ -750,9 +781,26 @@
@@ -751,9 +782,26 @@
p_213281_1_.func_218657_a("ShoulderEntityRight", this.func_192025_dl());
}
@@ -162,7 +162,7 @@
+ }
+ });
+ p_213281_1_.func_218657_a("Spawns", spawnlist);
+ if (spawnDimension != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ if (spawnDimension != net.minecraft.world.dimension.DimensionType.field_223227_a_) {
+ p_213281_1_.func_74778_a("SpawnDimension", spawnDimension.getRegistryName().toString());
+ }
}
@@ -172,7 +172,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) {
@@ -784,7 +832,7 @@
@@ -785,7 +833,7 @@
protected void func_190629_c(LivingEntity p_190629_1_) {
super.func_190629_c(p_190629_1_);
@@ -181,7 +181,7 @@
this.func_190777_m(true);
}
@@ -805,13 +853,15 @@
@@ -806,13 +854,15 @@
}
protected void func_184590_k(float p_184590_1_) {
@@ -198,7 +198,7 @@
if (hand == Hand.MAIN_HAND) {
this.func_184201_a(EquipmentSlotType.MAINHAND, ItemStack.field_190927_a);
} else {
@@ -827,11 +877,14 @@
@@ -828,11 +878,14 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -213,7 +213,7 @@
float f1 = f - p_70665_2_;
if (f1 > 0.0F && f1 < 3.4028235E37F) {
this.func_195067_a(Stats.field_212738_J, Math.round(f1 * 10.0F));
@@ -886,6 +939,8 @@
@@ -887,6 +940,8 @@
return ActionResultType.PASS;
} else {
@@ -222,7 +222,7 @@
ItemStack itemstack = this.func_184586_b(p_190775_2_);
ItemStack itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l();
if (p_190775_1_.func_184230_a(this, p_190775_2_)) {
@@ -893,6 +948,9 @@
@@ -894,6 +949,9 @@
itemstack.func_190920_e(itemstack1.func_190916_E());
}
@@ -232,7 +232,7 @@
return ActionResultType.SUCCESS;
} else {
if (!itemstack.func_190926_b() && p_190775_1_ instanceof LivingEntity) {
@@ -902,6 +960,7 @@
@@ -903,6 +961,7 @@
if (itemstack.func_111282_a(this, (LivingEntity)p_190775_1_, p_190775_2_)) {
if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) {
@@ -240,7 +240,7 @@
this.func_184611_a(p_190775_2_, ItemStack.field_190927_a);
}
@@ -928,6 +987,7 @@
@@ -929,6 +988,7 @@
}
public void func_71059_n(Entity p_71059_1_) {
@@ -248,7 +248,7 @@
if (p_71059_1_.func_70075_an()) {
if (!p_71059_1_.func_85031_j(this)) {
float f = (float)this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111126_e();
@@ -955,8 +1015,10 @@
@@ -956,8 +1016,10 @@
boolean flag2 = flag && this.field_70143_R > 0.0F && !this.field_70122_E && !this.func_70617_f_() && !this.func_70090_H() && !this.func_70644_a(Effects.field_76440_q) && !this.func_184218_aH() && p_71059_1_ instanceof LivingEntity;
flag2 = flag2 && !this.func_70051_ag();
@@ -260,7 +260,7 @@
}
f = f + f1;
@@ -1044,8 +1106,10 @@
@@ -1045,8 +1107,10 @@
}
if (!this.field_70170_p.field_72995_K && !itemstack1.func_190926_b() && entity instanceof LivingEntity) {
@@ -271,7 +271,7 @@
this.func_184611_a(Hand.MAIN_HAND, ItemStack.field_190927_a);
}
}
@@ -1087,7 +1151,7 @@
@@ -1088,7 +1152,7 @@
}
if (this.field_70146_Z.nextFloat() < f) {
@@ -280,7 +280,7 @@
this.func_184602_cy();
this.field_70170_p.func_72960_a(this, (byte)30);
}
@@ -1131,6 +1195,8 @@
@@ -1132,6 +1196,8 @@
}
public Either<PlayerEntity.SleepResult, Unit> func_213819_a(BlockPos p_213819_1_) {
@@ -289,7 +289,7 @@
Direction direction = this.field_70170_p.func_180495_p(p_213819_1_).func_177229_b(HorizontalBlock.field_185512_D);
if (!this.field_70170_p.field_72995_K) {
if (this.func_70608_bn() || !this.func_70089_S()) {
@@ -1141,7 +1207,7 @@
@@ -1142,7 +1208,7 @@
return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_HERE);
}
@@ -298,7 +298,7 @@
return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW);
}
@@ -1183,6 +1249,8 @@
@@ -1184,6 +1250,8 @@
private boolean func_190774_a(BlockPos p_190774_1_, Direction p_190774_2_) {
if (Math.abs(this.field_70165_t - (double)p_190774_1_.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)p_190774_1_.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)p_190774_1_.func_177952_p()) <= 3.0D) {
return true;
@@ -307,7 +307,7 @@
} else {
BlockPos blockpos = p_190774_1_.func_177972_a(p_190774_2_.func_176734_d());
return Math.abs(this.field_70165_t - (double)blockpos.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)blockpos.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)blockpos.func_177952_p()) <= 3.0D;
@@ -1195,6 +1263,7 @@
@@ -1196,6 +1264,7 @@
}
public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) {
@@ -315,7 +315,7 @@
Optional<BlockPos> optional = this.func_213374_dv();
super.func_213366_dy();
if (this.field_70170_p instanceof ServerWorld && p_70999_2_) {
@@ -1215,17 +1284,17 @@
@@ -1216,17 +1285,17 @@
}
public static Optional<Vec3d> func_213822_a(IWorldReader p_213822_0_, BlockPos p_213822_1_, boolean p_213822_2_) {
@@ -337,7 +337,7 @@
}
}
@@ -1240,23 +1309,67 @@
@@ -1241,23 +1310,67 @@
public void func_146105_b(ITextComponent p_146105_1_, boolean p_146105_2_) {
}
@@ -353,7 +353,7 @@
+ * @return The player specific spawn location for the dimension. May be null.
+ */
+ public BlockPos getBedLocation(net.minecraft.world.dimension.DimensionType dim) {
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_71077_c : spawnPosMap.get(dim.getRegistryName());
+ return dim == net.minecraft.world.dimension.DimensionType.field_223227_a_ ? field_71077_c : spawnPosMap.get(dim.getRegistryName());
+ }
+
+ @Deprecated //Forge: Use Dimension sensitive version
@@ -370,7 +370,7 @@
+ * @return The player specific spawn location for the dimension. May be null.
+ */
+ public boolean isSpawnForced(net.minecraft.world.dimension.DimensionType dim) {
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false);
+ return dim == net.minecraft.world.dimension.DimensionType.field_223227_a_ ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false);
+ }
+
+ @Deprecated //Forge: Use Dimension sensitive version
@@ -394,7 +394,7 @@
+ */
+ public void setSpawnPoint(@Nullable BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) {
+ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, pos, forced)) return;
+ if (dim != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ if (dim != net.minecraft.world.dimension.DimensionType.field_223227_a_) {
+ if (pos == null) {
+ spawnPosMap.remove(dim.getRegistryName());
+ spawnForcedMap.remove(dim.getRegistryName());
@@ -414,7 +414,7 @@
}
public void func_195066_a(ResourceLocation p_195066_1_) {
@@ -1422,6 +1535,8 @@
@@ -1423,6 +1536,8 @@
}
super.func_180430_e(p_180430_1_, p_180430_2_);
@@ -423,7 +423,7 @@
}
}
@@ -1684,7 +1799,10 @@
@@ -1685,7 +1800,10 @@
}
public ITextComponent func_145748_c_() {
@@ -435,7 +435,7 @@
return this.func_208016_c(itextcomponent);
}
@@ -1920,4 +2038,44 @@
@@ -1921,4 +2039,44 @@
return this.field_221260_g;
}
}
@@ -1,14 +1,23 @@
--- a/net/minecraft/entity/player/ServerPlayerEntity.java
+++ b/net/minecraft/entity/player/ServerPlayerEntity.java
@@ -433,6 +433,7 @@
@@ -436,6 +436,7 @@
}
public void func_70645_a(DamageSource p_70645_1_) {
+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return;
boolean flag = this.field_70170_p.func_82736_K().func_82766_b("showDeathMessages");
+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return;
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();
@@ -565,8 +566,10 @@
@@ -477,7 +478,7 @@
livingentity.func_191956_a(this, this.field_70744_aE, p_70645_1_);
if (!this.field_70170_p.field_72995_K && livingentity instanceof WitherEntity) {
boolean flag1 = false;
- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v);
BlockState blockstate = Blocks.field_222388_bz.func_176223_P();
if (this.field_70170_p.func_180495_p(blockpos).func_196958_f() && blockstate.func_196955_c(this.field_70170_p, blockpos)) {
@@ -568,8 +569,10 @@
return this.field_71133_b.func_71219_W();
}
@@ -18,8 +27,8 @@
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null;
this.field_184851_cj = true;
DimensionType dimensiontype = this.field_71093_bK;
if (dimensiontype == DimensionType.THE_END && p_212321_1_ == DimensionType.OVERWORLD) {
@@ -588,8 +591,8 @@
if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) {
@@ -591,8 +594,8 @@
this.field_71135_a.func_147359_a(new SServerDifficultyPacket(worldinfo.func_176130_y(), worldinfo.func_176123_z()));
PlayerList playerlist = this.field_71133_b.func_184103_al();
playerlist.func_187243_f(this);
@@ -30,24 +39,24 @@
double d0 = this.field_70165_t;
double d1 = this.field_70163_u;
double d2 = this.field_70161_v;
@@ -598,13 +601,11 @@
@@ -601,13 +604,11 @@
double d3 = 8.0D;
float f2 = f1;
serverworld.func_217381_Z().func_76320_a("moving");
+ double moveFactor = serverworld.func_201675_m().getMovementFactor() / serverworld1.func_201675_m().getMovementFactor();
+ d0 *= moveFactor;
+ d2 *= moveFactor;
if (dimensiontype == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.NETHER) {
if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223228_b_) {
this.field_193110_cw = new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- d0 /= 8.0D;
- d2 /= 8.0D;
- } else if (dimensiontype == DimensionType.NETHER && p_212321_1_ == DimensionType.OVERWORLD) {
- } else if (dimensiontype == DimensionType.field_223228_b_ && p_212321_1_ == DimensionType.field_223227_a_) {
- d0 *= 8.0D;
- d2 *= 8.0D;
} else if (dimensiontype == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.THE_END) {
} else if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223229_c_) {
BlockPos blockpos = serverworld1.func_180504_m();
d0 = (double)blockpos.func_177958_n();
@@ -668,6 +669,7 @@
@@ -671,6 +672,7 @@
this.field_71144_ck = -1;
this.field_71149_ch = -1.0F;
this.field_71146_ci = -1;
@@ -55,7 +64,7 @@
return this;
}
}
@@ -773,7 +775,7 @@
@@ -776,7 +778,7 @@
BlockPos blockpos = new BlockPos(i, j, k);
if (this.field_70170_p.func_175667_e(blockpos)) {
BlockState blockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -64,7 +73,7 @@
BlockPos blockpos1 = blockpos.func_177977_b();
BlockState blockstate1 = this.field_70170_p.func_180495_p(blockpos1);
Block block = blockstate1.func_177230_c();
@@ -816,6 +818,7 @@
@@ -819,6 +821,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;
@@ -72,7 +81,7 @@
return OptionalInt.of(this.field_71139_cq);
}
}
@@ -834,6 +837,7 @@
@@ -837,6 +840,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);
@@ -80,7 +89,7 @@
}
public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) {
@@ -891,6 +895,7 @@
@@ -894,6 +898,7 @@
public void func_71128_l() {
this.field_71070_bA.func_75134_a(this);
@@ -88,14 +97,14 @@
this.field_71070_bA = this.field_71069_bz;
}
@@ -1017,6 +1022,20 @@
@@ -1020,6 +1025,20 @@
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());
+
+ this.spawnPosMap = p_193104_1_.spawnPosMap;
+ this.spawnForcedMap = p_193104_1_.spawnForcedMap;
+ if(p_193104_1_.field_71093_bK != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ if(p_193104_1_.field_71093_bK != DimensionType.field_223227_a_) {
+ this.field_71077_c = p_193104_1_.field_71077_c;
+ this.field_82248_d = p_193104_1_.field_82248_d;
+ }
@@ -109,7 +118,7 @@
}
protected void func_70670_a(EffectInstance p_70670_1_) {
@@ -1239,15 +1258,15 @@
@@ -1242,15 +1261,15 @@
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_);
@@ -128,7 +137,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);
@@ -1256,6 +1275,7 @@
@@ -1259,6 +1278,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);
@@ -136,7 +145,7 @@
}
}
@@ -1290,6 +1310,8 @@
@@ -1293,6 +1313,8 @@
if (itementity == null) {
return null;
} else {
@@ -1,10 +1,10 @@
--- a/net/minecraft/entity/projectile/FireballEntity.java
+++ b/net/minecraft/entity/projectile/FireballEntity.java
@@ -36,7 +36,7 @@
@@ -37,7 +37,7 @@
this.func_174815_a(this.field_70235_a, entity);
}
- boolean flag = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing");
- boolean flag = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b);
+ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a);
this.field_70170_p.func_217398_a((Entity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, (float)this.field_92057_e, flag, flag ? Explosion.Mode.DESTROY : Explosion.Mode.NONE);
this.func_70106_y();
@@ -29,7 +29,7 @@
serverworld.func_195598_a(ParticleTypes.field_218422_X, d4, d5, d6, 2 + this.field_70146_Z.nextInt(2), (double)0.1F, 0.0D, (double)0.1F, 0.0D);
}
}
@@ -357,15 +357,26 @@
@@ -357,6 +357,7 @@
public int func_146034_e(ItemStack p_146034_1_) {
if (!this.field_70170_p.field_72995_K && this.field_146042_b != null) {
int i = 0;
@@ -37,15 +37,11 @@
if (this.field_146043_c != null) {
this.func_184527_k();
CriteriaTriggers.field_204811_D.func_204820_a((ServerPlayerEntity)this.field_146042_b, p_146034_1_, this, Collections.emptyList());
this.field_70170_p.func_72960_a(this, (byte)31);
@@ -364,8 +365,15 @@
i = this.field_146043_c instanceof ItemEntity ? 3 : 5;
} else if (this.field_146045_ax > 0) {
- LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, new BlockPos(this)).func_216015_a(LootParameters.field_216289_i, p_146034_1_).func_216023_a(this.field_70146_Z).func_186469_a((float)this.field_191518_aw + this.field_146042_b.func_184817_da());
+ LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, new BlockPos(this)).
+ func_216015_a(LootParameters.field_216289_i, p_146034_1_).
+ func_216023_a(this.field_70146_Z).func_186469_a((float)this.field_191518_aw + this.field_146042_b.func_184817_da());
+ lootcontext$builder.func_216015_a(LootParameters.field_216284_d, this.field_146042_b).
+ func_216015_a(LootParameters.field_216281_a,this);
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, new BlockPos(this)).func_216015_a(LootParameters.field_216289_i, p_146034_1_).func_216023_a(this.field_70146_Z).func_186469_a((float)this.field_191518_aw + this.field_146042_b.func_184817_da());
+ lootcontext$builder.func_216015_a(LootParameters.field_216284_d, this.field_146042_b).func_216015_a(LootParameters.field_216281_a, this);
LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(LootTables.field_186387_al);
List<ItemStack> list = loottable.func_216113_a(lootcontext$builder.func_216022_a(LootParameterSets.field_216262_c));
+ event = new net.minecraftforge.event.entity.player.ItemFishedEvent(list, this.field_146051_au ? 2 : 1, this);
@@ -57,7 +53,7 @@
CriteriaTriggers.field_204811_D.func_204820_a((ServerPlayerEntity)this.field_146042_b, p_146034_1_, this, list);
for(ItemStack itemstack : list) {
@@ -390,7 +401,7 @@
@@ -390,7 +398,7 @@
}
this.func_70106_y();
@@ -1,10 +1,10 @@
--- a/net/minecraft/entity/projectile/SmallFireballEntity.java
+++ b/net/minecraft/entity/projectile/SmallFireballEntity.java
@@ -36,7 +36,7 @@
this.func_174815_a(this.field_70235_a, entity);
@@ -40,7 +40,7 @@
entity.func_223308_g(i);
}
}
- } else if (this.field_70235_a == null || !(this.field_70235_a instanceof MobEntity) || this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
- } else if (this.field_70235_a == null || !(this.field_70235_a instanceof MobEntity) || this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
+ } else if (this.field_70235_a == null || !(this.field_70235_a instanceof MobEntity) || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a)) {
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)p_70227_1_;
BlockPos blockpos = blockraytraceresult.func_216350_a().func_177972_a(blockraytraceresult.func_216354_b());
@@ -1,6 +1,6 @@
--- a/net/minecraft/entity/projectile/WitherSkullEntity.java
+++ b/net/minecraft/entity/projectile/WitherSkullEntity.java
@@ -47,7 +47,7 @@
@@ -48,7 +48,7 @@
}
public float func_180428_a(Explosion p_180428_1_, IBlockReader p_180428_2_, BlockPos p_180428_3_, BlockState p_180428_4_, IFluidState p_180428_5_, float p_180428_6_) {
@@ -9,11 +9,11 @@
}
protected void func_70227_a(RayTraceResult p_70227_1_) {
@@ -80,7 +80,7 @@
@@ -81,7 +81,7 @@
}
}
- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing") ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
+ Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE;
this.field_70170_p.func_217398_a(this, this.field_70165_t, this.field_70163_u, this.field_70161_v, 1.0F, false, explosion$mode);
this.func_70106_y();
Loaded 100 of 402 files, more files were not shown because too many files have changed in this diff. Show more