Skip to content

Commit

Permalink
Merge remote-tracking branch 'fabric/mc1.19/fabric/dev' into mc1.19/f…
Browse files Browse the repository at this point in the history
…abric/dev

# Conflicts:
#	src/main/java/com/simibubi/create/Create.java
#	src/main/java/com/simibubi/create/content/redstone/thresholdSwitch/ThresholdSwitchBlockEntity.java
#	src/main/java/com/simibubi/create/foundation/data/TagGen.java
#	src/main/java/com/simibubi/create/infrastructure/data/CreateRegistrateTags.java
  • Loading branch information
IThundxr committed Feb 21, 2024
2 parents c926645 + 502bd5e commit 36b633b
Show file tree
Hide file tree
Showing 38 changed files with 268 additions and 3,140 deletions.
5 changes: 4 additions & 1 deletion FABRIC_CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ No formatting, just plain text. CurseForge support for it is terrible.
Change logging starts below:
----------
- update to patch F

- fix schematic-printing deployers consuming double the resources they should (#1273)
- fix invalid auto-shapeless recipes from appearing in EMI (#1148)
- potential fix for a rare belt-related crash (#941)
- potential fix for errors/crashes due to a missing locale (#1120)
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ repositories {
maven { url = "https://maven.parchmentmc.org" } // Parchment
maven { url = "https://maven.fabricmc.net/" } // FAPI, Loader
maven { url = "https://mvn.devos.one/snapshots/" } // Registrate, Porting Lib, Forge Tags, Milk Lib
maven { url = "https://cursemaven.com" } // Forge Config API Port
maven { url = "https://jitpack.io/" } // for Porting Lib: Mixin Extras, Fabric ASM
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.tterrag.com/" } // Flywheel
maven { url = "https://maven.shedaniel.me/" } // REI and deps
maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Sodium, Sandwichable
Expand Down Expand Up @@ -65,7 +66,7 @@ def dependencies(DependencyHandler deps) {

deps.modApi(deps.include("com.electronwill.night-config:core:$night_config_version"))
deps.modApi(deps.include("com.electronwill.night-config:toml:$night_config_version"))
deps.modApi(deps.include("curse.maven:forge-config-api-port-fabric-547434:$config_api_id"))
deps.modApi(deps.include("net.minecraftforge:forgeconfigapiport-fabric:$forge_config_api_port_version"))
deps.modApi(deps.include("com.jozufozu.flywheel:flywheel-fabric-$flywheel_minecraft_version:$flywheel_version"))
deps.modApi(deps.include("com.jamieswhiteshirt:reach-entity-attributes:$reach_entity_attributes_version"))
deps.modApi(deps.include("io.github.tropheusj:milk-lib:$milk_lib_version"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/simibubi/create/AllFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class AllFluids {
// fabric: various Attributes/Types replaced with corresponding handlers

public static final FluidEntry<PotionFluid> POTION =
REGISTRATE.virtualFluid("potion", PotionFluid::new)
REGISTRATE.virtualFluid("potion", /*PotionFluidAttributes::new,*/ PotionFluid::new)
.lang("Potion")
.fluidAttributes(PotionFluidVariantAttributeHandler::new)
.register();
Expand Down
49 changes: 21 additions & 28 deletions src/main/java/com/simibubi/create/Create.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import java.util.Random;

import com.simibubi.create.infrastructure.data.CreateRecipeSerializerTagsProvider;
import com.simibubi.create.foundation.recipe.AllIngredients;
import com.simibubi.create.infrastructure.data.CreateRecipeSerializerTagsProvider;

import org.slf4j.Logger;

Expand All @@ -19,10 +19,10 @@
import com.simibubi.create.content.equipment.potatoCannon.BuiltinPotatoProjectileTypes;
import com.simibubi.create.content.fluids.tank.BoilerHeaters;
import com.simibubi.create.content.kinetics.TorquePropagator;
import com.simibubi.create.content.kinetics.fan.processing.AllFanProcessingTypes;
import com.simibubi.create.content.kinetics.mechanicalArm.AllArmInteractionPointTypes;
import com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours;
import com.simibubi.create.content.redstone.link.RedstoneLinkNetworkHandler;
import com.simibubi.create.content.schematics.SchematicInstances;
import com.simibubi.create.content.schematics.ServerSchematicLoader;
import com.simibubi.create.content.trains.GlobalRailwayManager;
import com.simibubi.create.content.trains.bogey.BogeySizes;
Expand Down Expand Up @@ -117,29 +117,34 @@ public void onInitialize() { // onCtor
AllParticleTypes.register();
AllStructureProcessorTypes.register();
AllEntityDataSerializers.register();
AllPackets.registerPackets();
AllOreFeatureConfigEntries.init();
AllFeatures.register();
AllPlacementModifiers.register();
BuiltinRegistration.register();
BogeySizes.init();
AllBogeyStyles.register();

AllConfigs.register();

// FIXME: some of these registrations are not thread-safe
AllMovementBehaviours.registerDefaults();
AllInteractionBehaviours.registerDefaults();
AllPortalTracks.registerDefaults();
AllDisplayBehaviours.registerDefaults();
ContraptionMovementSetting.registerDefaults();
AllArmInteractionPointTypes.register();
AllFanProcessingTypes.register();
BlockSpoutingBehaviour.registerDefaults();
BogeySizes.init();
AllBogeyStyles.register();
// ----

ComputerCraftProxy.register();

Milk.enableMilkFluid();
CopperRegistries.inject();

Create.init();
// modEventBus.addListener(EventPriority.LOWEST, Create::gatherData); // CreateData entrypoint
// modEventBus.addListener(EventPriority.LOWEST, CreateDatagen::gatherData); // CreateData entrypoint
AllSoundEvents.register();

// causes class loading issues or something
Expand All @@ -153,34 +158,22 @@ public void onInitialize() { // onCtor
}

public static void init() {
AllPackets.registerPackets();
SchematicInstances.register();
BuiltinPotatoProjectileTypes.register();
AllFluids.registerFluidInteractions();

// event.enqueueWork(() -> {
AllAdvancements.register();
AllTriggers.register();
// TODO: custom registration should all happen in one place
// Most registration happens in the constructor.
// These registrations use Create's registered objects directly so they must run after registration has finished.
BuiltinPotatoProjectileTypes.register();
BoilerHeaters.registerDefaults();
AllFluids.registerFluidInteractions();
// });

// fabric: registration not done yet, do it later
ServerLifecycleEvents.SERVER_STARTING.register(server -> AttachedRegistry.unwrapAll());
}

public static void gatherData(FabricDataGenerator gen, ExistingFileHelper helper) {
CreateDatagen.addExtraRegistrateData();
// --

TagLangGen.datagen();

gen.addProvider(AllSoundEvents.provider(gen));
gen.addProvider(new CreateRecipeSerializerTagsProvider(gen));
gen.addProvider(new AllAdvancements(gen));
gen.addProvider(new StandardRecipeGen(gen));
gen.addProvider(new MechanicalCraftingRecipeGen(gen));
gen.addProvider(new SequencedAssemblyRecipeGen(gen));
ProcessingRecipeGen.registerAll(gen);
// AllOreFeatureConfigEntries.gatherData(gen);
// fabric: registration not done yet, do it later
ServerLifecycleEvents.SERVER_STARTING.register(server -> AttachedRegistry.unwrapAll());
AllAdvancements.register();
AllTriggers.register();
// });
}

public static ResourceLocation asResource(String path) {
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/com/simibubi/create/CreateData.java

This file was deleted.

34 changes: 18 additions & 16 deletions src/main/java/com/simibubi/create/compat/Mods.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* For compatibility with and without another mod present, we have to define load conditions of the specific code
*/
public enum Mods {
DYNAMICTREES,
TCONSTRUCT,
CURIOS,

AETHER,
COMPUTERCRAFT,
STORAGEDRAWERS,
XLPACKETS,
CONNECTIVITY,
CURIOS,
DYNAMICTREES,
OCCULTISM,
PACKETFIXER,
STORAGEDRAWERS,
TCONSTRUCT,
XLPACKETS,

// fabric mods
SANDWICHABLE,
Expand All @@ -33,18 +33,27 @@ public enum Mods {
SODIUM,
INDIUM;

private final String id;
private final boolean loaded;

Mods() {
loaded = FabricLoader.getInstance().isModLoaded(asId());
id = Lang.asId(name());
loaded = FabricLoader.getInstance().isModLoaded(id);
}

/**
* @return the mod id
*/
public String id() {
return id;
}

public ResourceLocation rl(String path) {
return new ResourceLocation(asId(), path);
return new ResourceLocation(id, path);
}

public Block getBlock(String id) {
return Registry.BLOCK.get(new ResourceLocation(asId(), id));
return Registry.BLOCK.get(rl(id));
}

/**
Expand All @@ -54,13 +63,6 @@ public boolean isLoaded() {
return loaded;
}

/**
* @return the mod id
*/
public String asId() {
return Lang.asId(name());
}

/**
* Simple hook to run code if a mod is installed
* @param toRun will be run only if the mod is loaded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void register(EmiRegistry registry) {
addAll(registry, AllRecipeTypes.MIXING, MIXING, MixingEmiRecipe::new);
for (CraftingRecipe recipe : manager.getAllRecipesFor(RecipeType.CRAFTING)) {
if (recipe instanceof ShapelessRecipe && !MechanicalPressBlockEntity.canCompress(recipe)
&& !AllRecipeTypes.shouldIgnoreInAutomation(recipe)) {
&& !AllRecipeTypes.shouldIgnoreInAutomation(recipe) && recipe.getIngredients().size() > 1) {
registry.addRecipe(new ShapelessEmiRecipe(AUTOMATIC_SHAPELESS, BasinRecipe.convertShapeless(recipe)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import com.simibubi.create.content.processing.recipe.ProcessingOutput;
import com.simibubi.create.content.processing.recipe.ProcessingRecipe;

import me.shedaniel.rei.api.common.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.display.Display;
import me.shedaniel.rei.api.common.entry.EntryIngredient;
import me.shedaniel.rei.api.common.util.EntryIngredients;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe;

public class CreateDisplay<R extends Recipe<?>> implements Display {
Expand All @@ -23,8 +28,21 @@ public CreateDisplay(R recipe, CategoryIdentifier<CreateDisplay<R>> id, List<Ent
}

public CreateDisplay(R recipe, CategoryIdentifier<CreateDisplay<R>> id) {
this(recipe, id, EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem())));
this.uid = id;
this.recipe = recipe;

this.input = EntryIngredients.ofIngredients(recipe.getIngredients());

if (recipe instanceof ProcessingRecipe) {
this.output = ((List<ItemStack>)((ProcessingRecipe) recipe).getRollableResultsAsItemStacks()).stream()
.map(EntryIngredients::of)
.collect(Collectors.toList());
} else {
this.output = Collections.singletonList(EntryIngredients.of(recipe.getResultItem()));
}
}



public R getRecipe() {
return recipe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
//
//import com.simibubi.create.compat.Mods;
//import com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour;
//import com.simibubi.create.foundation.utility.RegisteredObjects;
//
//import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant;
//import net.fabricmc.fabric.api.transfer.v1.storage.Storage;
//import net.minecraft.world.item.ItemStack;
//import net.minecraft.world.level.block.entity.BlockEntity;
//import net.minecraft.world.level.block.entity.BlockEntityType;
//import net.minecraftforge.items.IItemHandler;
//
//public class StorageDrawers {
//
// public static boolean isDrawer(BlockEntity be) {
// return be != null && Mods.STORAGEDRAWERS.id()
// .equals(BlockEntityType.getKey(be.getType())
// .getNamespace());
// .equals(RegisteredObjects.getKeyOrThrow(be.getType())
// .getNamespace());
// }
//
// public static float getTrueFillLevel(Storage<ItemVariant> inv, FilteringBehaviour filtering) {
// public static float getTrueFillLevel(IItemHandler inv, FilteringBehaviour filtering) {
// float occupied = 0;
// float totalSpace = 0;
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public class ContraptionData {
* Connectivity expands the NBT packet limit to 2 GB.
*/
public static final int CONNECTIVITY_LIMIT = Integer.MAX_VALUE;
/**
* Packet Fixer expands the NBT packet limit to 200 MB.
*/
public static final int PACKET_FIXER_LIMIT = 209_715_200;
/**
* XL Packets expands the NBT packet limit to 2 GB.
*/
Expand All @@ -44,8 +48,11 @@ public class ContraptionData {
if (Mods.XLPACKETS.isLoaded()) {
limit = XL_PACKETS_LIMIT;
}
if (Mods.PACKETFIXER.isLoaded()) {
limit = PACKET_FIXER_LIMIT;
}

PICKUP_LIMIT = limit;
PICKUP_LIMIT = limit;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ public PushReaction getPistonPushReaction() {
public void setPortalEntrancePos() {
portalEntrancePos = blockPosition();
}

@Override
public PortalInfo findDimensionEntryPoint(ServerLevel pDestination) {
return super.findDimensionEntryPoint(pDestination);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ChatType;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ScaffoldingBlockItem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.simibubi.create.content.equipment.armor;

import java.util.Map;

import java.util.List;
import java.util.Map;

import com.simibubi.create.AllTags.AllFluidTags;
import com.simibubi.create.foundation.advancement.AllAdvancements;
Expand Down
Loading

0 comments on commit 36b633b

Please sign in to comment.