Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Apr 6, 2024
2 parents f4af9e8 + b783fdc commit 6836c81
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 33 deletions.
16 changes: 8 additions & 8 deletions examples/config/cyclic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
enabled = true

[cyclic.enchantment.beekeeper]
#Set false to disable enchantment
#Set false to stop enchantment from working
enabled = true

[cyclic.enchantment.experience_boost]
Expand Down Expand Up @@ -140,7 +140,7 @@
#Base perecentage chance to drop a head on kill
#Range: 1 ~ 99
percent = 20
#Set false to disable enchantment
#Set false to stop enchantment from working
enabled = true

[cyclic.enchantment.quickshot]
Expand All @@ -162,7 +162,7 @@
enabled = true

[cyclic.enchantment.auto_smelt]
#Set false to disable enchantment
#Set false to stop enchantment from working
enabled = true

[cyclic.enchantment.growth]
Expand Down Expand Up @@ -280,11 +280,6 @@
#Range: 0 ~ 64000
energy_cost_xdim = 8000

[cyclic.blocks.sound]
#Sound Recorder - how far out does it listen to record sounds
#Range: 1 ~ 64
radius = 8

#battery settings
[cyclic.blocks.battery]
#RF/t charging rate for the battery item slot
Expand Down Expand Up @@ -495,6 +490,11 @@
#RECIPE IDS HERE. Block these recipe ids from being reversed, but do not block all recipes for this output item
ignore_recipes = ["minecraft:white_dye_from_lily_of_the_valley", "minecraft:orange_dye_from_orange_tulip", "minecraft:magenta_dye_from_allium", "minecraft:magenta_dye_from_lilac", "minecraft:light_blue_dye_from_blue_orchid", "minecraft:yellow_dye_from_sunflower", "minecraft:yellow_dye_from_dandelion", "minecraft:pink_dye_from_peony", "minecraft:pink_dye_from_pink_tulip", "minecraft:light_gray_dye_from_oxeye_daisy", "minecraft:light_gray_dye_from_azure_bluet", "minecraft:light_gray_dye_from_white_tulip", "minecraft:blue_dye_from_cornflower", "minecraft:red_dye_from_poppy", "minecraft:red_dye_from_rose_bush", "minecraft:red_dye_from_tulip", "minecraft:black_dye_from_wither_rose", "minecraft:blue_dye", "minecraft:black_dye", "minecraft:brown_dye", "botania:cobweb", "minecraft:magma_cream", "minecraft:beacon", "minecraft:stick_from_bamboo_item", "minecraft:netherite_ingot_from_netherite_block", "mysticalagriculture:essence*", "mysticalagriculture:farmland_till", "refinedstorage:coloring_recipes*", "forcecraft:transmutation*", "cyclic:flower_purple_tulip", "cyclic:flower_absalon_tulip", "cyclic:flower_cyan", "cyclic:flower_lime_carnation", "cyclic:fireball", "cyclic:shapeless/spark"]

[cyclic.blocks.sound_recorder]
#Sound Recorder - how far out does it listen to record sounds
#Range: 1 ~ 64
radius = 8

[cyclic.blocks.anti_beacon]
#List of extra effects to clear. supports wildcard such as 'cyclic:*'. (This list is is used even if harmful_potions=false or true both)
potion_list = ["minecraft:poison", "minecraft:*_poison", "minecraft:wither", "cyclic:gravity", "minecraft:weakness", "minecraft:slowness"]
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.daemon=false
# as needed run/server.properties : online-mode=false

curse_id=239286
mod_version=1.8.3-SNAPSHOT
mod_version=1.8.3

mc_version=1.19.2
forge_version=43.2.14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ protected Player getLookingPlayer(int maxRange, boolean mustCrouch) {
return null;
}

public void tryDumpFakePlayerInvo(WeakReference<FakePlayer> fp, ItemStackHandler out, boolean onGround) {
// TODO: this could use a refactor
public void tryDumpFakePlayerInvo(WeakReference<FakePlayer> fp, ItemStackHandler out, boolean dropItemsOnGround) {
if (out == null) {
return;
}
Expand All @@ -110,23 +111,20 @@ public void tryDumpFakePlayerInvo(WeakReference<FakePlayer> fp, ItemStackHandler
if (fpItem.isEmpty()) {
continue;
}
ModCyclic.LOGGER.info("NONEMPTY itemstack found what do we do");
if (fpItem == fp.get().getMainHandItem()) {
ModCyclic.LOGGER.info("aha continue main hand item dont doump it");
continue;
}
for (int j = 0; j < out.getSlots(); j++) {
ModCyclic.LOGGER.info(fpItem + "insert itit here" + j);
fpItem = out.insertItem(j, fpItem, false);
}
if (onGround) {
if (dropItemsOnGround) {
toDrop.add(fpItem);
}
else {
fp.get().getInventory().items.set(i, fpItem);
}
}
if (onGround) {
if (dropItemsOnGround) {
ItemStackUtil.drop(this.level, this.worldPosition.above(), toDrop);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.common.ForgeConfigSpec.IntValue;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;

public class SoundmufflerBlock extends BlockCyclic {

private static final int VOL_REDUCE_PER_BLOCK = 2;
public static IntValue RADIUS; // 6

public SoundmufflerBlock(Properties properties) {
super(properties.strength(1F).sound(SoundType.SCAFFOLDING));
Expand All @@ -37,7 +35,7 @@ public void onPlaySound(PlaySoundEvent event) {
SoundInstance sound = event.getSound();
final boolean isPowered = false; // if im NOT powered, im running
List<BlockPos> blocks = BlockstatesUtil.findBlocks(clientWorld, new BlockPos(sound.getX(), sound.getY(), sound.getZ()), this,
RADIUS.get(),
ConfigRegistry.SOUND_RADIUS.get(),
isPowered);
if (blocks == null || blocks.size() == 0) {
return;
Expand All @@ -50,6 +48,7 @@ public void onPlaySound(PlaySoundEvent event) {
rebuildSoundWithVolume(event, sound, volume);
}

@OnlyIn(Dist.CLIENT)
private static void rebuildSoundWithVolume(PlaySoundEvent event, SoundInstance sound, float newVolume) {
try {
//WARNING": DO NOT USE getVolume anywhere here it just crashes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import com.lothrazar.cyclic.block.BlockCyclic;
import com.lothrazar.cyclic.config.ConfigRegistry;
import com.lothrazar.cyclic.net.PacketRecordSound;
import com.lothrazar.cyclic.registry.MenuTypeRegistry;
import com.lothrazar.cyclic.registry.PacketRegistry;
Expand All @@ -17,14 +18,11 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.common.ForgeConfigSpec.IntValue;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;

public class BlockSoundRecorder extends BlockCyclic {

public static IntValue RADIUS;

public BlockSoundRecorder(Properties properties) {
super(properties.strength(1F).sound(SoundType.SCAFFOLDING));
MinecraftForge.EVENT_BUS.register(this);
Expand All @@ -50,7 +48,8 @@ public void onPlaySound(PlaySoundEvent event) {
} //long term/repeating/music
final boolean isPowered = false; // if im NOT powered, im running
List<BlockPos> blocks = BlockstatesUtil.findBlocks(clientWorld,
new BlockPos(event.getSound().getX(), event.getSound().getY(), event.getSound().getZ()), this, RADIUS.get(), isPowered);
new BlockPos(event.getSound().getX(), event.getSound().getY(), event.getSound().getZ()), this,
ConfigRegistry.RECORDER_RADIUS.get(), isPowered);
for (BlockPos nearby : blocks) {
String sid = event.getSound().getLocation().toString();
PacketRegistry.INSTANCE.sendToServer(new PacketRecordSound(sid, nearby));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
public class TileDiamondSpikes extends TileBlockEntityCyclic {

WeakReference<FakePlayer> fakePlayer;
final static boolean dropItemsOnGround = true;

public TileDiamondSpikes(BlockPos pos, BlockState state) {
super(TileRegistry.SPIKES_DIAMOND.get(), pos, state);
Expand Down Expand Up @@ -63,7 +64,7 @@ public void tick() {
fakePlayer.get().setItemInHand(InteractionHand.MAIN_HAND, sword);
}
if (level.random.nextDouble() < 0.001F) {
tryDumpFakePlayerInvo(fakePlayer, null, true);
tryDumpFakePlayerInvo(fakePlayer, null, dropItemsOnGround);
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/lothrazar/cyclic/block/user/TileUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,16 @@ public void tick() {
catch (Exception e) {
ModCyclic.LOGGER.error("User action item error", e);
}
tryDumpFakePlayerInvo(fakePlayer, this.outputSlots, false);
final boolean dropItemsOnGround = false;
tryDumpFakePlayerInvo(fakePlayer, this.outputSlots, dropItemsOnGround);
}

private void depositOutputMainhand() {
var usedItem = fakePlayer.get().getItemInHand(InteractionHand.MAIN_HAND);
for (int slotId = 0; slotId < outputSlots.getSlots(); slotId++) {
if (!usedItem.isEmpty()) {
// usedItem = outputSlots.insertItem(slotId, usedItem.copy(), false);
if (outputSlots.insertItem(slotId, usedItem.copy(), true).isEmpty()) {
usedItem = outputSlots.insertItem(slotId, usedItem.copy(), false);
// userSlots.setStackInSlot(0, usedItem);
TileBlockEntityCyclic.tryEquipItem(usedItem, fakePlayer, InteractionHand.MAIN_HAND);
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import com.lothrazar.cyclic.block.packager.TilePackager;
import com.lothrazar.cyclic.block.peatfarm.TilePeatFarm;
import com.lothrazar.cyclic.block.shapebuilder.TileStructure;
import com.lothrazar.cyclic.block.soundmuff.SoundmufflerBlock;
import com.lothrazar.cyclic.block.soundrecord.BlockSoundRecorder;
import com.lothrazar.cyclic.block.spawntriggers.BlockAltarNoTraders;
import com.lothrazar.cyclic.block.spawntriggers.CandlePeaceBlock;
import com.lothrazar.cyclic.block.sprinkler.TileSprinkler;
Expand Down Expand Up @@ -126,6 +124,7 @@ public class ConfigRegistry {
public static BooleanValue CYAN_PODZOL_LEGACY;
public static BooleanValue TRANSFER_NODES_DIMENSIONAL;
public static IntValue SOUND_RADIUS;
public static IntValue RECORDER_RADIUS;
static {
buildDefaults();
initConfig();
Expand Down Expand Up @@ -409,8 +408,6 @@ private static void initConfig() {
+ "If you change it to false it will only work if the target is in the same dimension.")
.define("wireless_transfer_dimensional", true);
//buffer size for cables
SoundmufflerBlock.RADIUS = CFG.comment("Radius to find and muffle sounds. ")
.defineInRange("soundproofing.radius", 6, 1, 128);
TileAntiBeacon.HARMFUL_POTIONS = CFG.comment("If true, then all potions marked as harmful/negative will be used in addition to the 'anti_beacon.potion_list' for cures and immunities (used by both sponge and artemisbeacon).")
.define("harmful_potions", true);
TileAntiBeacon.RADIUS = CFG.comment("Radius to protect players and entities from potion effects being applied (used by both sponge and artemisbeacon). ")
Expand Down Expand Up @@ -480,14 +477,13 @@ private static void initConfig() {
CFG.push("anvil_void");
TileAnvilVoid.FLUIDPAY = CFG.comment("Payment per void action, if not zero").defineInRange("fluid_cost", 25, 0, 16000);
CFG.pop();
CFG.push("sound");
BlockSoundRecorder.RADIUS = CFG.comment("Sound Recorder - how far out does it listen to record sounds").defineInRange("radius", 8, 1, 64);
CFG.push("sound_recorder");
RECORDER_RADIUS = CFG.comment("Sound Recorder - how far out does it listen to record sounds").defineInRange("radius", 8, 1, 64);
CFG.pop();
CFG.comment("Ender shelf settings").push("ender_shelf");
EnderShelfItemHandler.BOOKS_PER_ROW = CFG.comment("Each shelf has five rows. Set the number of books stored per row here").defineInRange("books_per_row", 256, 1, 1024);
EnderShelfHelper.MAX_DIST = CFG.comment("Controller Max distance to search (using manhattan distance)").defineInRange("controller_distance", 64, 1, 256);
CFG.pop(); // ender_shelf*6
//
CFG.comment("soundproofing settings").push("soundproofing"); //soundproofing
SOUND_RADIUS = CFG.comment("Radius of sound proofing (distance from each block that it will listen)").defineInRange("radius", 6, 1, 16);
CFG.pop(); //soundproofing
Expand Down

0 comments on commit 6836c81

Please sign in to comment.