20w30a WIP
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-07-25 13:34:16 -04:00
parent a5bad4c9cb
commit 4a1a4e5866
15 changed files with 38 additions and 6 deletions

View File

@ -28,6 +28,7 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modImplementation "io.github.prospector:modmenu:${project.modmenu_version}" modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
//modImplementation "me.shedaniel:RoughlyEnoughItems:${project.roughlyenoughitems_version}"
modImplementation "me.shedaniel.cloth:config-2:${project.cloth_config_version}" modImplementation "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
include "me.shedaniel.cloth:config-2:${project.cloth_config_version}" include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"

View File

@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version = 20w29a minecraft_version = 20w30a
yarn_build = 8 yarn_build = 8
fabric_loader_version = 0.9.0+build.204 fabric_loader_version = 0.9.0+build.204
@ -13,8 +13,9 @@ org.gradle.jvmargs = -Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_api_version = 0.14.6+build.377-1.16 fabric_api_version = 0.16.0+build.386-1.16
modmenu_version = 1.14.5+build.30 modmenu_version = 1.14.5+build.30
cloth_config_version = 4.6.0 cloth_config_version = 4.6.0
autoconfig_version = 3.2.0-unstable autoconfig_version = 3.2.0-unstable
libstructure_version = 1.3 libstructure_version = 1.3
roughlyenoughitems_version = 4.10.3

View File

@ -31,9 +31,13 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.recipe.SpecialRecipeSerializer; import net.minecraft.recipe.SpecialRecipeSerializer;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.feature.OreFeatureConfig;
@ -64,7 +68,7 @@ public class EnergonRelics implements ModInitializer {
public static final Item VERIDIUM_INGOT_ITEM = new Item(new Item.Settings().group(ITEM_GROUP)); public static final Item VERIDIUM_INGOT_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
public static final SimpleBlock VERIDIUM_ORE_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.STONE).requiresTool().strength(3f, 3f)); public static final SimpleBlock VERIDIUM_ORE_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.STONE).requiresTool().strength(3f, 3f));
public static final SimpleBlock VERIDIUM_BLOCK_BLOCK = new VeridiumBlockBlock(); public static final SimpleBlock VERIDIUM_BLOCK_BLOCK = new VeridiumBlockBlock();
public static final ConfiguredFeature<?, ?> VERIDIUM_ORE_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.class_5436.field_25845, EnergonRelics.VERIDIUM_ORE_BLOCK.getDefaultState(), 9)).method_30377(32).spreadHorizontally().repeat(2); public static final ConfiguredFeature<?, ?> VERIDIUM_ORE_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, EnergonRelics.VERIDIUM_ORE_BLOCK.getDefaultState(), 9)).method_30377(32).spreadHorizontally().repeat(2);
public static final Item CIRCUIT_BOARD_ITEM = new Item(new Item.Settings().group(ITEM_GROUP)); public static final Item CIRCUIT_BOARD_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
@ -82,6 +86,9 @@ public class EnergonRelics implements ModInitializer {
public static final ForcefieldBlock FORCEFIELD_BLOCK = new ForcefieldBlock(); public static final ForcefieldBlock FORCEFIELD_BLOCK = new ForcefieldBlock();
public static final ForcefieldProjectorBlock FORCEFIELD_PROJECTOR_BLOCK = new ForcefieldProjectorBlock(); public static final ForcefieldProjectorBlock FORCEFIELD_PROJECTOR_BLOCK = new ForcefieldProjectorBlock();
private static final Identifier BEEP_SOUND_ID = new Identifier(NAMESPACE, "beep");
private static final SoundEvent BEEP_SOUND_EVENT = new SoundEvent(BEEP_SOUND_ID);
@Override @Override
public void onInitialize() { public void onInitialize() {
NETWORK_CHIP_ITEM = Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "network_chip"), new NetworkChipItem()); NETWORK_CHIP_ITEM = Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "network_chip"), new NetworkChipItem());
@ -125,5 +132,13 @@ public class EnergonRelics implements ModInitializer {
FORCEFIELD_BLOCK.register("forcefield"); FORCEFIELD_BLOCK.register("forcefield");
FORCEFIELD_PROJECTOR_BLOCK.register("forcefield_projector"); FORCEFIELD_PROJECTOR_BLOCK.register("forcefield_projector");
Registry.register(Registry.SOUND_EVENT, BEEP_SOUND_ID, BEEP_SOUND_EVENT);
}
public static void playBeep(World world, BlockPos pos) {
if (!world.isClient()) {
world.playSound(null, pos, BEEP_SOUND_EVENT, SoundCategory.BLOCKS, 0.5f, 1f);
}
} }
} }

View File

@ -59,7 +59,7 @@ public class LightningRodBlockEntity extends EnergyProviderBlockEntity implement
LightningEntity entity = EntityType.LIGHTNING_BOLT.create(getWorld()); LightningEntity entity = EntityType.LIGHTNING_BOLT.create(getWorld());
assert entity != null; assert entity != null;
entity.updatePosition(getPos().getX() + 0.5d, getPos().getY(), getPos().getZ() + 0.5d); entity.updatePosition(getPos().getX() + 0.5d, getPos().getY(), getPos().getZ() + 0.5d);
entity.method_29498(true); entity.setCosmetic(true);
Objects.requireNonNull(getWorld()).spawnEntity(entity); Objects.requireNonNull(getWorld()).spawnEntity(entity);
cooldown = HardcodedConfig.LIGHTNING_ROD_COOLDOWN; cooldown = HardcodedConfig.LIGHTNING_ROD_COOLDOWN;

View File

@ -62,6 +62,7 @@ public abstract class EnergyProviderBlock extends SimpleBlockWithEntity {
((EnergyProviderBlockEntity) entity).placeStack(stack, world); ((EnergyProviderBlockEntity) entity).placeStack(stack, world);
stack.setCount(0); stack.setCount(0);
} }
EnergonRelics.playBeep(world, pos);
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
} else { } else {
return ActionResult.FAIL; return ActionResult.FAIL;
@ -72,6 +73,7 @@ public abstract class EnergyProviderBlock extends SimpleBlockWithEntity {
ItemStack newStack = ((EnergyProviderBlockEntity) entity).takeStack(world); ItemStack newStack = ((EnergyProviderBlockEntity) entity).takeStack(world);
player.setStackInHand(hand, newStack); player.setStackInHand(hand, newStack);
} }
EnergonRelics.playBeep(world, pos);
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
} else { } else {
return ActionResult.FAIL; return ActionResult.FAIL;

View File

@ -58,6 +58,7 @@ public class MultimeterItem extends Item {
if (!world.isClient()) { if (!world.isClient()) {
Objects.requireNonNull(context.getPlayer()).sendMessage(text, true); Objects.requireNonNull(context.getPlayer()).sendMessage(text, true);
} }
EnergonRelics.playBeep(world, context.getBlockPos());
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
} else { } else {
return ActionResult.PASS; return ActionResult.PASS;

View File

@ -85,6 +85,7 @@ public class NetworkChipItem extends Item {
NetworkComponent component = NetworkComponent.getInstance(serverWorld); NetworkComponent component = NetworkComponent.getInstance(serverWorld);
((EnergyReceiverBlockEntity) entity).toggle(getOrCreateID(context.getStack(), component)); ((EnergyReceiverBlockEntity) entity).toggle(getOrCreateID(context.getStack(), component));
} }
EnergonRelics.playBeep(world, context.getBlockPos());
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
} else { } else {
return ActionResult.PASS; return ActionResult.PASS;

View File

@ -1,7 +1,6 @@
package com.thebrokenrail.energonrelics.mixin; package com.thebrokenrail.energonrelics.mixin;
import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.structure.StructureGeneratorBlock;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures; import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
@ -19,6 +18,6 @@ public class MixinDefaultBiomeFeatures {
@Inject(at = @At("RETURN"), method = "addDefaultUndergroundStructures") @Inject(at = @At("RETURN"), method = "addDefaultUndergroundStructures")
private static void addDefaultUndergroundStructures(Biome biome, CallbackInfo info) { private static void addDefaultUndergroundStructures(Biome biome, CallbackInfo info) {
StructureGeneratorBlock.addToBiome(biome); //StructureGeneratorBlock.addToBiome(biome);
} }
} }

View File

@ -0,0 +1,12 @@
{
"beep": {
"sounds": [
"energonrelics:beep1",
"energonrelics:beep2",
"energonrelics:beep3",
"energonrelics:beep4",
"energonrelics:beep5",
"energonrelics:beep6"
]
}
}