Add PoeticRainbow Texture Set
@ -1,3 +1,5 @@
|
||||
![Poster](images/poster.png)
|
||||
|
||||
# EnergonRelics
|
||||
TBD
|
||||
|
||||
@ -5,4 +7,5 @@ TBD
|
||||
[View Changelog](CHANGELOG.md)
|
||||
|
||||
## Credits
|
||||
- ``@PoeticRainbow#5928`` on Discord For The Logo
|
||||
- ``@PoeticRainbow#5928`` on Discord For The Logo And Poster
|
||||
- ``@PoeticRainbow#5928`` on Discord For Their Texture Set
|
24
TODO
@ -1,24 +0,0 @@
|
||||
Network Chips:
|
||||
- Contain a Network ID In NBT
|
||||
- When Held, Highlights Supported Blocks
|
||||
- When Right-Cliking On A Supported-Block Add it To The Network
|
||||
Energy Recievers:
|
||||
- Conatin network ID(s)
|
||||
- Requests a certain amount of power every tick
|
||||
- Spreads out power ewuest over all networks
|
||||
- Chunk loads unloaded networks
|
||||
- No energy transfer speed restrictions
|
||||
Energy Providers:
|
||||
- Contaisn Network Chip
|
||||
- Can only provide power to recievers within 60 blocks
|
||||
- Can be an energy reciever
|
||||
Battery:
|
||||
- Surrounded on all but one sides by Battery casing, last side covered by battery controller
|
||||
- Energy reiever for charging
|
||||
- Energy prvodier for usage
|
||||
- Highlight covers entire multi-block
|
||||
Reactor:
|
||||
- Temporary battery
|
||||
- Refreshes battery every 10 ticks, no fuel set battery to 0, if fuel fill battery
|
||||
|
||||
On each tick an energy receiver can add an "action", an action has a success function, a fail function, and a cost, the action is propagated up to the energy provider, which will either execute the success function and deduct the energy amount, or execute the fail function.
|
Before Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 658 B |
Before Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 584 B |
Before Width: | Height: | Size: 628 B |
Before Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 527 B |
12
build.gradle
@ -16,9 +16,17 @@ minecraft {
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
|
||||
modCompile "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
|
||||
|
||||
modCompile "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 "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
|
||||
include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
|
||||
|
||||
modImplementation "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
|
||||
include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@ -14,3 +14,6 @@ org.gradle.jvmargs = -Xmx1G
|
||||
# Dependencies
|
||||
# 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
|
||||
modmenu_version = 1.14.5+build.30
|
||||
cloth_config_version = 4.6.0
|
||||
autoconfig_version = 3.2.0-unstable
|
||||
|
@ -13,8 +13,11 @@ import com.thebrokenrail.energonrelics.block.EnergonLightBlock;
|
||||
import com.thebrokenrail.energonrelics.block.SolarPanelBlock;
|
||||
import com.thebrokenrail.energonrelics.block.SwitchBlock;
|
||||
import com.thebrokenrail.energonrelics.block.util.SimpleBlock;
|
||||
import com.thebrokenrail.energonrelics.client.config.UserConfig;
|
||||
import com.thebrokenrail.energonrelics.item.MultimeterItem;
|
||||
import com.thebrokenrail.energonrelics.item.NetworkChipItem;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.serializer.GsonConfigSerializer;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -26,7 +26,7 @@ public class DefensiveLaserBlock extends EnergyProviderBlock {
|
||||
public static final BooleanProperty POWERED = Properties.POWERED;
|
||||
|
||||
public DefensiveLaserBlock() {
|
||||
super(FabricBlockSettings.of(Material.GLASS, MaterialColor.BLACK).requiresTool().strength(50.0F, 1200.0F));
|
||||
super(FabricBlockSettings.of(Material.GLASS, MaterialColor.BLACK).requiresTool().strength(50.0F, 1200.0F).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).lightLevel(state -> state.get(POWERED) ? 7 : 0));
|
||||
setDefaultState(getDefaultState().with(POWERED, false));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.entity;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.block.DefensiveLaserBlock;
|
||||
import com.thebrokenrail.energonrelics.energy.core.EnergyReceiverBlockEntity;
|
||||
@ -157,7 +157,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
|
||||
|
||||
private Predicate<LivingEntity> getTargetPredicate(boolean useCurrentRotation) {
|
||||
return entity -> {
|
||||
if (entity.isAlive() && (!(entity instanceof PlayerEntity) || !((PlayerEntity) entity).isCreative()) && !entity.isInvisible() && entity.getPos().distanceTo(getPosVec()) <= Config.DEFENSIVE_LASER_RANGE) {
|
||||
if (entity.isAlive() && (!(entity instanceof PlayerEntity) || !((PlayerEntity) entity).isCreative()) && !entity.isInvisible() && entity.getPos().distanceTo(getPosVec()) <= HardcodedConfig.DEFENSIVE_LASER_RANGE) {
|
||||
Vec3d entityPos = entity.getPos();
|
||||
Vec3d start;
|
||||
if (useCurrentRotation) {
|
||||
@ -174,7 +174,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
|
||||
}
|
||||
|
||||
private List<LivingEntity> getEntities(Predicate<LivingEntity> predicate) {
|
||||
return Objects.requireNonNull(getWorld()).getEntitiesByClass(LivingEntity.class, new Box(getPos()).expand(Config.DEFENSIVE_LASER_RANGE), predicate);
|
||||
return Objects.requireNonNull(getWorld()).getEntitiesByClass(LivingEntity.class, new Box(getPos()).expand(HardcodedConfig.DEFENSIVE_LASER_RANGE), predicate);
|
||||
}
|
||||
|
||||
private Entity getDummyEntity() {
|
||||
@ -187,7 +187,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
|
||||
Vec3d posVec = getPosVec(pos);
|
||||
Vec3d collision = null;
|
||||
for (LivingEntity entity : entities) {
|
||||
Optional<Vec3d> optional = entity.getBoundingBox().rayTrace(posVec, posVec.add(rotation.getRayVector().multiply(Config.DEFENSIVE_LASER_RANGE)));
|
||||
Optional<Vec3d> optional = entity.getBoundingBox().rayTrace(posVec, posVec.add(rotation.getRayVector().multiply(HardcodedConfig.DEFENSIVE_LASER_RANGE)));
|
||||
if (optional.isPresent()) {
|
||||
Vec3d vec = optional.get();
|
||||
if (collision == null || vec.distanceTo(posVec) < collision.distanceTo(posVec)) {
|
||||
@ -198,7 +198,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
|
||||
|
||||
Vec3d rotationVec = rotation.getRayVector();
|
||||
Vec3d start = rotationVec.add(posVec);
|
||||
Vec3d end = rotationVec.multiply(Config.DEFENSIVE_LASER_RANGE).add(posVec);
|
||||
Vec3d end = rotationVec.multiply(HardcodedConfig.DEFENSIVE_LASER_RANGE).add(posVec);
|
||||
HitResult result = world.rayTrace(new RayTraceContext(start, end, RayTraceContext.ShapeType.COLLIDER, RayTraceContext.FluidHandling.ANY, getDummyEntity()));
|
||||
if (result.getType() != HitResult.Type.MISS && (collision == null || result.getPos().distanceTo(posVec) < collision.distanceTo(posVec))) {
|
||||
collision = result.getPos();
|
||||
@ -206,31 +206,31 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
|
||||
|
||||
double distance;
|
||||
if (collision != null) {
|
||||
world.createExplosion(null, collision.getX(), collision.getY(), collision.getZ(), 1, Explosion.DestructionType.NONE);
|
||||
world.createExplosion(null, collision.getX(), collision.getY(), collision.getZ(), 2f, Explosion.DestructionType.NONE);
|
||||
|
||||
distance = posVec.distanceTo(collision);
|
||||
} else {
|
||||
distance = Config.DEFENSIVE_LASER_RANGE;
|
||||
distance = HardcodedConfig.DEFENSIVE_LASER_RANGE;
|
||||
}
|
||||
|
||||
double multiplier = 6d;
|
||||
double multiplier = 4d;
|
||||
distance = distance * multiplier;
|
||||
for (int i = 0; i < distance; i++) {
|
||||
Vec3d vec = rotationVec.multiply(i / multiplier).add(posVec);
|
||||
((ServerWorld) world).spawnParticles(ParticleTypes.END_ROD, vec.getX(), vec.getY(), vec.getZ(), 1, 0, 0, 0, 0.1f);
|
||||
((ServerWorld) world).spawnParticles(ParticleTypes.END_ROD, vec.getX(), vec.getY(), vec.getZ(), 1, 0, 0, 0, 0.4f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tickEnergy() {
|
||||
assert getWorld() != null;
|
||||
addAction(Action.createBlockStatePropertyAction(Config.DEFENSIVE_LASER_IDLE_ENERGY_REQUIRED, DefensiveLaserBlock.POWERED, true, false));
|
||||
addAction(Action.createBlockStatePropertyAction(HardcodedConfig.DEFENSIVE_LASER_IDLE_ENERGY_REQUIRED, DefensiveLaserBlock.POWERED, true, false));
|
||||
if (getCachedState().get(DefensiveLaserBlock.POWERED)) {
|
||||
if (countdown > 0) {
|
||||
countdown--;
|
||||
}
|
||||
if (countdown == 1) {
|
||||
addAction(new Action(Config.DEFENSIVE_LASER_FIRE_ENERGY_REQUIRED, (world, pos, state) -> {
|
||||
addAction(new Action(HardcodedConfig.DEFENSIVE_LASER_FIRE_ENERGY_REQUIRED, (world, pos, state) -> {
|
||||
firing = false;
|
||||
fire(world, pos);
|
||||
}, (world, pos, state) -> firing = false));
|
||||
@ -246,7 +246,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
|
||||
}
|
||||
} else {
|
||||
if (getTargetPredicate(false).test(target)) {
|
||||
Optional<Vec3d> optional = target.getBoundingBox().rayTrace(getPosVec(), getPosVec().add(rotation.getRayVector().multiply(Config.DEFENSIVE_LASER_RANGE)));
|
||||
Optional<Vec3d> optional = target.getBoundingBox().rayTrace(getPosVec(), getPosVec().add(rotation.getRayVector().multiply(HardcodedConfig.DEFENSIVE_LASER_RANGE)));
|
||||
if (optional.isPresent() && getTargetPredicate(true).test(target)) {
|
||||
countdown = COUNTDOWN;
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.entity;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import com.thebrokenrail.energonrelics.block.EnergonLightBlock;
|
||||
import com.thebrokenrail.energonrelics.energy.core.EnergyReceiverBlockEntity;
|
||||
import com.thebrokenrail.energonrelics.energy.core.util.Action;
|
||||
@ -13,6 +13,6 @@ public class EnergonLightBlockEntity extends EnergyReceiverBlockEntity {
|
||||
|
||||
@Override
|
||||
protected void tickEnergy() {
|
||||
addAction(Action.createBlockStatePropertyAction(Config.ENERGON_LIGHT_ENERGY_REQUIRED, EnergonLightBlock.POWERED, true, false));
|
||||
addAction(Action.createBlockStatePropertyAction(HardcodedConfig.ENERGON_LIGHT_ENERGY_REQUIRED, EnergonLightBlock.POWERED, true, false));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.entity;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import com.thebrokenrail.energonrelics.energy.helper.EnergyGeneratorBlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@ -30,7 +30,7 @@ public class SolarPanelBlockEntity extends EnergyGeneratorBlockEntity {
|
||||
public long getDisplayEnergy() {
|
||||
if (hasWorld() && Objects.requireNonNull(getWorld()).getDimension().hasSkyLight()) {
|
||||
int light = getLight();
|
||||
return (long) ((float) Config.SOLAR_PANEL_MAX_ENERGY_OUTPUT * ((float) light / 15f));
|
||||
return (long) ((float) HardcodedConfig.SOLAR_PANEL_MAX_ENERGY_OUTPUT * ((float) light / 15f));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.entity.battery;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.energy.core.EnergyReceiverBlockEntity;
|
||||
@ -48,7 +48,7 @@ public class PassiveBatteryControllerBlockEntity extends EnergyReceiverBlockEnti
|
||||
|
||||
@Override
|
||||
protected void tickEnergy() {
|
||||
long charge = Config.BATTERY_CHARGE_RATE;
|
||||
long charge = HardcodedConfig.BATTERY_CHARGE_RATE;
|
||||
if (!isActiveController()) {
|
||||
addAction(new Action(charge, (world, pos, state) -> {
|
||||
BlockEntity entity = world.getBlockEntity(pos);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.entity.reactor;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.entity.battery.PassiveBatteryControllerBlockEntity;
|
||||
@ -55,9 +55,13 @@ public class ReactorControllerBlockEntity extends EnergyGeneratorBlockEntity {
|
||||
|
||||
@Override
|
||||
public long getDisplayEnergy() {
|
||||
Reactor reactor = getReactor();
|
||||
if (reactor != null && reactor.core.isReacting()) {
|
||||
return Config.REACTOR_ENERGY_OUTPUT;
|
||||
if (getCachedState().get(ReactorControllerBlock.POWERED)) {
|
||||
Reactor reactor = getReactor();
|
||||
if (reactor != null && reactor.core.isReacting()) {
|
||||
return HardcodedConfig.REACTOR_ENERGY_OUTPUT;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.entity.reactor;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
@ -32,7 +32,7 @@ public class ReactorCoreBlockEntity extends BlockEntity implements Tickable {
|
||||
}
|
||||
|
||||
void startReaction() {
|
||||
reactionTime = Config.REACTOR_TIME;
|
||||
reactionTime = HardcodedConfig.REACTOR_TIME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,18 +2,42 @@ package com.thebrokenrail.energonrelics.client;
|
||||
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.block.util.EnergyProviderBlock;
|
||||
import com.thebrokenrail.energonrelics.client.config.UserConfig;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.serializer.GsonConfigSerializer;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class EnergonRelicsClient implements ClientModInitializer {
|
||||
@Environment(EnvType.CLIENT)
|
||||
private static class ReloadSerializer<T extends ConfigData> extends GsonConfigSerializer<T> {
|
||||
public ReloadSerializer(Config definition, Class<T> configClass) {
|
||||
super(definition, configClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(T config) throws SerializationException {
|
||||
super.serialize(config);
|
||||
MinecraftClient client = MinecraftClient.getInstance();
|
||||
if (client.getResourceManager() != null) {
|
||||
client.reloadResources();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
EnergyProviderBlock.initRenderer();
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.THERMAL_GLASS_BLOCK, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.DEFENSIVE_LASER_BLOCK, RenderLayer.getCutout());
|
||||
|
||||
AutoConfig.register(UserConfig.class, ReloadSerializer::new);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.thebrokenrail.energonrelics.client;
|
||||
|
||||
import com.thebrokenrail.energonrelics.client.config.UserConfig;
|
||||
import io.github.prospector.modmenu.api.ConfigScreenFactory;
|
||||
import io.github.prospector.modmenu.api.ModMenuApi;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ModMenu implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return screen -> AutoConfig.getConfigScreen(UserConfig.class, screen).get();
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.thebrokenrail.energonrelics.client.config;
|
||||
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Config(name = EnergonRelics.NAMESPACE)
|
||||
public class UserConfig implements ConfigData {
|
||||
public enum TextureSet {
|
||||
TheBrokenRail,
|
||||
PoeticRainbow;
|
||||
|
||||
public String namespace() {
|
||||
return EnergonRelics.NAMESPACE + '-' + name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
public TextureSet textureSet = TextureSet.TheBrokenRail;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics;
|
||||
package com.thebrokenrail.energonrelics.config;
|
||||
|
||||
public class Config {
|
||||
public class HardcodedConfig {
|
||||
public static final int POWER_RANGE = 64;
|
||||
|
||||
public static final int ENERGON_LIGHT_ENERGY_REQUIRED = 5;
|
||||
@ -12,7 +12,7 @@ public class Config {
|
||||
public static final int REACTOR_TIME = 2400;
|
||||
public static final int REACTOR_ENERGY_OUTPUT = 250;
|
||||
|
||||
public static final int DEFENSIVE_LASER_RANGE = 18;
|
||||
public static final int DEFENSIVE_LASER_RANGE = 28;
|
||||
public static final int DEFENSIVE_LASER_IDLE_ENERGY_REQUIRED = 32;
|
||||
public static final int DEFENSIVE_LASER_FIRE_ENERGY_REQUIRED = 64;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.energy.core;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.component.NetworkComponent;
|
||||
import com.thebrokenrail.energonrelics.energy.core.util.Action;
|
||||
@ -55,7 +55,7 @@ public class EnergyProviderBlockEntity extends BlockEntity implements EnergyProv
|
||||
|
||||
@Override
|
||||
public final boolean isWithinDistance(Vec3d pos) {
|
||||
return getPos().isWithinDistance(pos, Config.POWER_RANGE);
|
||||
return getPos().isWithinDistance(pos, HardcodedConfig.POWER_RANGE);
|
||||
}
|
||||
|
||||
private ItemStack stack = ItemStack.EMPTY;
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.thebrokenrail.energonrelics.mixin;
|
||||
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.client.config.UserConfig;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.resource.AbstractFileResourcePack;
|
||||
import net.minecraft.resource.ResourceType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Mixin(AbstractFileResourcePack.class)
|
||||
public class MixinAbstractFileResourcePack {
|
||||
@Inject(at = @At("HEAD"), method = "open", cancellable = true)
|
||||
public void injectOpen(ResourceType type, Identifier id, CallbackInfoReturnable<InputStream> info) {
|
||||
if (id.getNamespace().equals(EnergonRelics.NAMESPACE)) {
|
||||
try {
|
||||
Identifier newID = new Identifier(AutoConfig.getConfigHolder(UserConfig.class).getConfig().textureSet.namespace(), id.getPath());
|
||||
InputStream in = ((AbstractFileResourcePack) (Object) this).open(type, newID);
|
||||
if (in != null) {
|
||||
info.setReturnValue(in);
|
||||
}
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "contains", cancellable = true)
|
||||
public void injectContains(ResourceType type, Identifier id, CallbackInfoReturnable<Boolean> info) {
|
||||
if (id.getNamespace().equals(EnergonRelics.NAMESPACE)) {
|
||||
Identifier newID = new Identifier(AutoConfig.getConfigHolder(UserConfig.class).getConfig().textureSet.namespace(), id.getPath());
|
||||
boolean out = ((AbstractFileResourcePack) (Object) this).contains(type, newID);
|
||||
if (out) {
|
||||
info.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"top": "energonrelics:block/thermal_casing",
|
||||
"front": "energonrelics:block/active_battery_controller",
|
||||
"side": "energonrelics:block/thermal_casing"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"top": "energonrelics:block/thermal_casing",
|
||||
"front": "energonrelics:block/passive_battery_controller",
|
||||
"side": "energonrelics:block/thermal_casing"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"top": "energonrelics:block/thermal_casing",
|
||||
"front": "energonrelics:block/reactor_controller",
|
||||
"side": "energonrelics:block/thermal_casing"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"top": "energonrelics:block/thermal_casing",
|
||||
"front": "energonrelics:block/reactor_controller",
|
||||
"side": "energonrelics:block/thermal_casing"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 514 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 525 B |
After Width: | Height: | Size: 525 B |
After Width: | Height: | Size: 595 B |
After Width: | Height: | Size: 578 B |
After Width: | Height: | Size: 261 B |
After Width: | Height: | Size: 426 B |
@ -1,7 +1,10 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "energonrelics:block/defensive_laser"
|
||||
"powered=false": {
|
||||
"model": "energonrelics:block/defensive_laser_off"
|
||||
},
|
||||
"powered=true": {
|
||||
"model": "energonrelics:block/defensive_laser_on"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,5 +21,7 @@
|
||||
"block.energonrelics.veridium_ore": "Veridium Ore",
|
||||
"block.energonrelics.veridium_block": "Veridium Block",
|
||||
"item.energonrelics.defensive_laser_core": "Defensive laser Core",
|
||||
"block.energonrelics.defensive_laser": "Defensive Laser"
|
||||
"block.energonrelics.defensive_laser": "Defensive Laser",
|
||||
"text.autoconfig.energonrelics.title": "EnergonRelics",
|
||||
"text.autoconfig.energonrelics.option.textureSet": "Texture Set"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "energonrelics:block/defensive_laser_off"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "energonrelics:block/defensive_laser"
|
||||
"all": "energonrelics:block/defensive_laser_on"
|
||||
}
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"parent": "energonrelics:block/defensive_laser"
|
||||
"parent": "energonrelics:block/defensive_laser_on"
|
||||
}
|
Before Width: | Height: | Size: 775 B After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 752 B |
@ -3,6 +3,7 @@
|
||||
"package": "com.thebrokenrail.energonrelics.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"client": [
|
||||
"MixinAbstractFileResourcePack"
|
||||
],
|
||||
"mixins": [
|
||||
"MixinDefaultBiomeFeatures",
|
||||
|
@ -21,6 +21,9 @@
|
||||
],
|
||||
"client": [
|
||||
"com.thebrokenrail.energonrelics.client.EnergonRelicsClient"
|
||||
],
|
||||
"modmenu": [
|
||||
"com.thebrokenrail.energonrelics.client.ModMenu"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
|