Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-1.19-lts' into master-1.2…
Browse files Browse the repository at this point in the history
…0-lts
  • Loading branch information
rubensworks committed Nov 19, 2024
2 parents c0b724b + 2b65c71 commit 4de0f29
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public class GeneralConfig extends DummyConfig {
@ConfigurableProperty(category = "machine", comment = "The distance from which part offsets should be shown.", minimalValue = 1, configLocation = ModConfig.Type.SERVER)
public static int partOffsetRenderDistance = 16;

@ConfigurableProperty(category = "machine", comment = "The maximum values that Part Offset items will have when dropped from a broken part.", minimalValue = 1, configLocation = ModConfig.Type.SERVER)
public static int enchancementOffsetPartDropValue = 4;

public GeneralConfig() {
super(IntegratedDynamics._instance, "general");
}
Expand Down
18 changes: 4 additions & 14 deletions src/main/java/org/cyclops/integrateddynamics/RegistryEntries.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,13 @@
import net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType;
import net.minecraft.world.level.material.FlowingFluid;
import net.minecraftforge.registries.ObjectHolder;
import org.cyclops.integrateddynamics.block.BlockCable;
import org.cyclops.integrateddynamics.block.BlockDryingBasin;
import org.cyclops.integrateddynamics.block.BlockEnergyBattery;
import org.cyclops.integrateddynamics.block.BlockFluidLiquidChorus;
import org.cyclops.integrateddynamics.block.BlockFluidMenrilResin;
import org.cyclops.integrateddynamics.block.BlockMechanicalDryingBasin;
import org.cyclops.integrateddynamics.block.BlockMechanicalSqueezer;
import org.cyclops.integrateddynamics.block.BlockSqueezer;
import org.cyclops.integrateddynamics.block.*;
import org.cyclops.integrateddynamics.blockentity.*;
import org.cyclops.integrateddynamics.core.blockentity.BlockEntityMultipartTicking;
import org.cyclops.integrateddynamics.core.inventory.container.ContainerAspectSettings;
import org.cyclops.integrateddynamics.core.inventory.container.ContainerPartSettings;
import org.cyclops.integrateddynamics.core.item.ItemBlockEnergyContainer;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeDryingBasin;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeEnergyContainerCombination;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeMechanicalDryingBasin;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeMechanicalSqueezer;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeNbtClear;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeSqueezer;
import org.cyclops.integrateddynamics.core.recipe.type.*;
import org.cyclops.integrateddynamics.inventory.container.*;
import org.cyclops.integrateddynamics.item.ItemEnhancement;
import org.cyclops.integrateddynamics.item.ItemFacade;
Expand Down Expand Up @@ -95,6 +83,8 @@ public class RegistryEntries {
public static final BlockDryingBasin BLOCK_DRYING_BASIN = null;
@ObjectHolder(registryName = "block", value = "integrateddynamics:energy_battery")
public static final BlockEnergyBattery BLOCK_ENERGY_BATTERY = null;
@ObjectHolder(registryName = "block", value = "integrateddynamics:energy_battery_creative")
public static final BlockCreativeEnergyBattery BLOCK_ENERGY_BATTERY_CREATIVE = null;
@ObjectHolder(registryName = "block", value = "integrateddynamics:block_liquid_chorus")
public static final BlockFluidLiquidChorus BLOCK_FLUID_LIQUID_CHORUS = null;
@ObjectHolder(registryName = "block", value = "integrateddynamics:block_menril_resin")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public BlockEntityEnergyBatteryConfig() {
IntegratedDynamics._instance,
"energy_battery",
(eConfig) -> new BlockEntityType<>(BlockEntityEnergyBattery::new,
Sets.newHashSet(RegistryEntries.BLOCK_ENERGY_BATTERY), null)
Sets.newHashSet(RegistryEntries.BLOCK_ENERGY_BATTERY, RegistryEntries.BLOCK_ENERGY_BATTERY_CREATIVE), null)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,14 @@
import org.cyclops.cyclopscore.config.extendedconfig.BlockConfig;
import org.cyclops.cyclopscore.datastructure.DimPos;
import org.cyclops.cyclopscore.init.ModBase;
import org.cyclops.integrateddynamics.GeneralConfig;
import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.RegistryEntries;
import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.network.INetworkElement;
import org.cyclops.integrateddynamics.api.network.IPartNetworkElement;
import org.cyclops.integrateddynamics.api.network.event.INetworkEvent;
import org.cyclops.integrateddynamics.api.part.IPartContainer;
import org.cyclops.integrateddynamics.api.part.IPartState;
import org.cyclops.integrateddynamics.api.part.IPartType;
import org.cyclops.integrateddynamics.api.part.PartPos;
import org.cyclops.integrateddynamics.api.part.PartRenderPosition;
import org.cyclops.integrateddynamics.api.part.PartTarget;
import org.cyclops.integrateddynamics.api.part.PartTypeAdapter;
import org.cyclops.integrateddynamics.api.part.*;
import org.cyclops.integrateddynamics.core.block.IgnoredBlock;
import org.cyclops.integrateddynamics.core.helper.L10NValues;
import org.cyclops.integrateddynamics.core.helper.PartHelpers;
Expand Down Expand Up @@ -180,9 +175,21 @@ public void addDrops(PartTarget target, S state, List<ItemStack> itemStacks, boo

// Save enhancements
if (!saveState && state.getMaxOffset() > 0) {
ItemStack itemStack = new ItemStack(RegistryEntries.ITEM_ENHANCEMENT_OFFSET);
RegistryEntries.ITEM_ENHANCEMENT_OFFSET.setEnhancementValue(itemStack, state.getMaxOffset());
itemStacks.add(itemStack);
// Drop Part Offset items each with as maximum the GeneralConfig.enchancementOffsetPartDropValue offset value.
int remainingOffset = state.getMaxOffset();
while (remainingOffset > 0) {
int offset;
if (remainingOffset < GeneralConfig.enchancementOffsetPartDropValue) {
offset = remainingOffset;
} else {
offset = GeneralConfig.enchancementOffsetPartDropValue;
}
remainingOffset -= offset;

ItemStack itemStack = new ItemStack(RegistryEntries.ITEM_ENHANCEMENT_OFFSET);
RegistryEntries.ITEM_ENHANCEMENT_OFFSET.setEnhancementValue(itemStack, offset);
itemStacks.add(itemStack);
}
}
}

Expand Down

0 comments on commit 4de0f29

Please sign in to comment.