Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.20.x' into 1.20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
XFactHD committed Dec 12, 2023
2 parents db98a5e + 365aebe commit 71c889a
Show file tree
Hide file tree
Showing 131 changed files with 582 additions and 738 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jetbrains_annotations_version=24.0.1
slf4j_api_version=2.0.7
apache_maven_artifact_version=3.8.5
jarjar_version=0.4.0
fancy_mod_loader_version=1.0.16
fancy_mod_loader_version=1.0.17
mojang_logging_version=1.1.1
log4j_version=2.19.0
guava_version=31.1.2-jre
Expand Down
12 changes: 0 additions & 12 deletions patches/net/minecraft/Util.java.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
--- a/net/minecraft/Util.java
+++ b/net/minecraft/Util.java
@@ -186,6 +_,11 @@
return 255;
}

+ // We add these inner classes to compensate for Mojang's missing inner classes and shift the anonymous class index.
+ // This allows us to obfuscate subsequent anonymous inner classes correctly.
+ @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT1 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } };
+ @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT2 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } };
+
public static ExecutorService backgroundExecutor() {
return BACKGROUND_EXECUTOR;
}
@@ -261,7 +_,7 @@
.getSchema(DataFixUtils.makeKey(SharedConstants.getCurrentVersion().getDataVersion().getVersion()))
.getChoiceType(p_137552_, p_137553_);
Expand Down
19 changes: 16 additions & 3 deletions patches/net/minecraft/world/item/FishingRodItem.java.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
--- a/net/minecraft/world/item/FishingRodItem.java
+++ b/net/minecraft/world/item/FishingRodItem.java
@@ -64,4 +_,11 @@
@@ -22,7 +_,11 @@
if (p_41291_.fishing != null) {
if (!p_41290_.isClientSide) {
int i = p_41291_.fishing.retrieve(itemstack);
+ ItemStack original = itemstack.copy();
itemstack.hurtAndBreak(i, p_41291_, p_41288_ -> p_41288_.broadcastBreakEvent(p_41292_));
+ if(itemstack.isEmpty()) {
+ net.neoforged.neoforge.event.EventHooks.onPlayerDestroyItem(p_41291_, original, p_41292_);
+ }
}

p_41290_.playSound(
@@ -63,5 +_,12 @@
@Override
public int getEnchantmentValue() {
return 1;
}
+ }
+
+ /* ******************** FORGE START ******************** */
+
+ @Override
+ public boolean canPerformAction(ItemStack stack, net.neoforged.neoforge.common.ToolAction toolAction) {
+ return net.neoforged.neoforge.common.ToolActions.DEFAULT_FISHING_ROD_ACTIONS.contains(toolAction);
+ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package net.neoforged.neoforge.client;

import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
Expand All @@ -24,13 +25,13 @@
public class ClientNeoForgeMod {
@SubscribeEvent
public static void onRegisterGeometryLoaders(ModelEvent.RegisterGeometryLoaders event) {
event.register("empty", EmptyModel.LOADER);
event.register("elements", ElementsModel.Loader.INSTANCE);
event.register("obj", ObjLoader.INSTANCE);
event.register("fluid_container", DynamicFluidContainerModel.Loader.INSTANCE);
event.register("composite", CompositeModel.Loader.INSTANCE);
event.register("item_layers", ItemLayerModel.Loader.INSTANCE);
event.register("separate_transforms", SeparateTransformsModel.Loader.INSTANCE);
event.register(new ResourceLocation("neoforge", "empty"), EmptyModel.LOADER);
event.register(new ResourceLocation("neoforge", "elements"), ElementsModel.Loader.INSTANCE);
event.register(new ResourceLocation("neoforge", "obj"), ObjLoader.INSTANCE);
event.register(new ResourceLocation("neoforge", "fluid_container"), DynamicFluidContainerModel.Loader.INSTANCE);
event.register(new ResourceLocation("neoforge", "composite"), CompositeModel.Loader.INSTANCE);
event.register(new ResourceLocation("neoforge", "item_layers"), ItemLayerModel.Loader.INSTANCE);
event.register(new ResourceLocation("neoforge", "separate_transforms"), SeparateTransformsModel.Loader.INSTANCE);
}

@SubscribeEvent
Expand All @@ -40,6 +41,6 @@ public static void onRegisterReloadListeners(RegisterClientReloadListenersEvent

@SubscribeEvent
public static void onRegisterNamedRenderTypes(RegisterNamedRenderTypesEvent event) {
event.register("item_unlit", RenderType.translucent(), NeoForgeRenderTypes.ITEM_UNSORTED_UNLIT_TRANSLUCENT.get());
event.register(new ResourceLocation("neoforge", "item_unlit"), RenderType.translucent(), NeoForgeRenderTypes.ITEM_UNSORTED_UNLIT_TRANSLUCENT.get());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.client.ClientHooks;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
Expand All @@ -44,8 +44,7 @@
* Fired for on different events/actions relating to {@linkplain EntityRenderer entity renderers}.
* See the various subclasses for listening to different events.
*
* <p>These events are fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>These events are fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*
* @see EntityRenderersEvent.RegisterLayerDefinitions
* @see EntityRenderersEvent.RegisterRenderers
Expand All @@ -60,8 +59,7 @@ protected EntityRenderersEvent() {}
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class RegisterLayerDefinitions extends EntityRenderersEvent {
@ApiStatus.Internal
Expand All @@ -88,8 +86,7 @@ public void registerLayerDefinition(ModelLayerLocation layerLocation, Supplier<L
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class RegisterRenderers extends EntityRenderersEvent {
@ApiStatus.Internal
Expand Down Expand Up @@ -122,7 +119,7 @@ public <T extends BlockEntity> void registerBlockEntityRenderer(BlockEntityType<
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* <p>This event is fired on the mod-specific event bus,
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class AddLayers extends EntityRenderersEvent {
Expand Down Expand Up @@ -196,7 +193,7 @@ public EntityRendererProvider.Context getContext() {
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* <p>This event is fired on the mod-specific event bus,
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class CreateSkullModels extends EntityRenderersEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.client.model.geometry.IGeometryLoader;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -40,8 +40,7 @@ protected ModelEvent() {}
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class ModifyBakingResult extends ModelEvent implements IModBusEvent {
private final Map<ResourceLocation, BakedModel> models;
Expand Down Expand Up @@ -76,8 +75,7 @@ public ModelBakery getModelBakery() {
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class BakingCompleted extends ModelEvent implements IModBusEvent {
private final ModelManager modelManager;
Expand Down Expand Up @@ -119,8 +117,7 @@ public ModelBakery getModelBakery() {
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class RegisterAdditional extends ModelEvent implements IModBusEvent {
private final Set<ResourceLocation> models;
Expand All @@ -143,8 +140,7 @@ public void register(ResourceLocation model) {
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class RegisterGeometryLoaders extends ModelEvent implements IModBusEvent {
private final Map<ResourceLocation, IGeometryLoader<?>> loaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import net.minecraft.server.packs.resources.PreparableReloadListener;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.event.AddReloadListenerEvent;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -23,8 +23,7 @@
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterClientReloadListenersEvent extends Event implements IModBusEvent {
private final ReloadableResourceManager resourceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.world.inventory.tooltip.TooltipComponent;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import org.jetbrains.annotations.ApiStatus;

/**
Expand All @@ -21,8 +21,7 @@
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterClientTooltipComponentFactoriesEvent extends Event implements IModBusEvent {
private final Map<Class<? extends TooltipComponent>, Function<TooltipComponent, ClientTooltipComponent>> factories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
import net.minecraft.world.level.ColorResolver;
import net.minecraft.world.level.ItemLike;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import org.jetbrains.annotations.ApiStatus;

/**
* Fired for registering block and item color handlers at the appropriate time.
* See the two subclasses for registering block or item color handlers.
*
* <p>These events are fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>These events are fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*
* @see RegisterColorHandlersEvent.Block
* @see RegisterColorHandlersEvent.Item
Expand All @@ -38,8 +37,7 @@ protected RegisterColorHandlersEvent() {}
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class Block extends RegisterColorHandlersEvent {
private final BlockColors blockColors;
Expand Down Expand Up @@ -77,8 +75,7 @@ public void register(BlockColor blockColor, net.minecraft.world.level.block.Bloc
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public static class Item extends RegisterColorHandlersEvent {
private final ItemColors itemColors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
import net.minecraft.client.renderer.DimensionSpecialEffects;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import org.jetbrains.annotations.ApiStatus;

/**
* Allows users to register custom {@link DimensionSpecialEffects} for their dimensions.
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterDimensionSpecialEffectsEvent extends Event implements IModBusEvent {
private final Map<ResourceLocation, DimensionSpecialEffects> effects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import org.jetbrains.annotations.ApiStatus;

/**
Expand All @@ -20,8 +20,7 @@
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterEntitySpectatorShadersEvent extends Event implements IModBusEvent {
private final Map<EntityType<?>, ResourceLocation> shaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import java.util.Map;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.client.gui.overlay.IGuiOverlay;
import net.neoforged.neoforge.client.gui.overlay.VanillaGuiOverlay;
import org.jetbrains.annotations.ApiStatus;
Expand All @@ -25,8 +25,7 @@
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterGuiOverlaysEvent extends Event implements IModBusEvent {
private final Map<ResourceLocation, IGuiOverlay> overlays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import net.neoforged.fml.LogicalSide;
import net.neoforged.fml.event.IModBusEvent;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.client.IItemDecorator;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -22,8 +22,7 @@
*
* <p>This event is not {@linkplain ICancellableEvent cancelable}, and does not {@linkplain HasResult have a result}.
*
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterItemDecorationsEvent extends Event implements IModBusEvent {

Expand Down
Loading

0 comments on commit 71c889a

Please sign in to comment.