mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-28 07:55:53 +00:00
Forge 1.19.3
Created a CreativeModeTabEvent to register creative mode tabs and populate entries per tab Moved datapack registries to DataPackRegistryEvent.NewRegistry event instead of tying them to ForgeRegistry Made it easier for mods to datagen datapack builtin entries with DatapackBuiltinEntriesProvider Provided access to lookupProvider for datagen Updated dependencies to match versions used by vanilla and update JarJar to 0.3.18 Added a test mod for the new CreativeModeTabEvent Throws better error message for Forge registries in tag datagen Deleted ForgeRegistryTagsProvider Updated ClientChatReceivedEvent and ServerChatEvent for Mojang changes Added patches for both sign related methods in ModelLayers Changed RegisterShadersEvent to use ResourceProvider Migrated old Mojang math types to JOML Co-authored-by: Marc Hermans <[email protected]> Co-authored-by: LexManos <[email protected]> Co-authored-by: sciwhiz12 <[email protected]> Co-authored-by: coehlrich <[email protected]>
This commit is contained in:
1 parent
617ecb7ad3
commit
8255d7aed3
726 files changed
+7615
-6653
No files matched your search
@@ -230,18 +230,18 @@ public class BlockEvent extends Event
|
||||
@HasResult
|
||||
public static class CreateFluidSourceEvent extends Event
|
||||
{
|
||||
private final LevelReader level;
|
||||
private final Level level;
|
||||
private final BlockPos pos;
|
||||
private final BlockState state;
|
||||
|
||||
public CreateFluidSourceEvent(LevelReader level, BlockPos pos, BlockState state)
|
||||
public CreateFluidSourceEvent(Level level, BlockPos pos, BlockState state)
|
||||
{
|
||||
this.level = level;
|
||||
this.pos = pos;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public LevelReader getLevel()
|
||||
public Level getLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ package net.minecraftforge.event.level;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
@@ -16,6 +18,7 @@ import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* This event is fired whenever a sapling, fungus, mushroom or azalea grows into a tree.
|
||||
@@ -36,6 +39,7 @@ public class SaplingGrowTreeEvent extends LevelEvent
|
||||
{
|
||||
private final RandomSource randomSource;
|
||||
private final BlockPos pos;
|
||||
@Nullable
|
||||
private Holder<? extends ConfiguredFeature<?, ?>> feature;
|
||||
|
||||
@Deprecated(forRemoval = true, since = "1.19.2")
|
||||
@@ -44,7 +48,7 @@ public class SaplingGrowTreeEvent extends LevelEvent
|
||||
this(level, randomSource, pos, null);
|
||||
}
|
||||
|
||||
public SaplingGrowTreeEvent(LevelAccessor level, RandomSource randomSource, BlockPos pos, Holder<? extends ConfiguredFeature<?, ?>> feature)
|
||||
public SaplingGrowTreeEvent(LevelAccessor level, RandomSource randomSource, BlockPos pos, @Nullable Holder<? extends ConfiguredFeature<?, ?>> feature)
|
||||
{
|
||||
super(level);
|
||||
this.randomSource = randomSource;
|
||||
@@ -69,13 +73,18 @@ public class SaplingGrowTreeEvent extends LevelEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the holder of the feature which will be placed}
|
||||
* {@return the holder of the feature which will be placed, possibly null}
|
||||
*/
|
||||
@Nullable
|
||||
public Holder<? extends ConfiguredFeature<?, ?>> getFeature() {
|
||||
return feature;
|
||||
}
|
||||
|
||||
public void setFeature(Holder<? extends ConfiguredFeature<?, ?>> feature) {
|
||||
public void setFeature(@Nullable Holder<? extends ConfiguredFeature<?, ?>> feature) {
|
||||
this.feature = feature;
|
||||
}
|
||||
|
||||
public void setFeature(ResourceKey<ConfiguredFeature<?, ?>> featureKey) {
|
||||
this.feature = this.getLevel().registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(featureKey).orElse(null);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user