Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Console Textures #90

Merged
merged 14 commits into from
Feb 7, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class ConsoleModelCollection {





public ConsoleModelCollection() {
factoryConsoleModel = new FactoryConsoleModel(Minecraft.getInstance().getEntityModels().bakeLayer((ModelRegistry.FACTORY_CONSOLE)));
nukaConsoleModel = new NukaConsoleModel(Minecraft.getInstance().getEntityModels().bakeLayer((ModelRegistry.NUKA_CONSOLE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public static void registerPatterns() {
/*Myst*/
addPattern(ConsoleTheme.MYST, new Pattern(new ResourceLocation(TardisRefined.MODID, "molten"), "myst/myst_console_molten"));

/*Victorian*/
addPattern(ConsoleTheme.VICTORIAN, new Pattern(new ResourceLocation(TardisRefined.MODID, "smissmass"), "victorian/victorian_console_smissmass"));
addPattern(ConsoleTheme.VICTORIAN, new Pattern(new ResourceLocation(TardisRefined.MODID, "grant"), "victorian/victorian_console_grant"));

/*Initiative*/
addPattern(ConsoleTheme.INITIATIVE, new Pattern(new ResourceLocation(TardisRefined.MODID, "aperture"), "initiative/initiative_console_aperture"));
addPattern(ConsoleTheme.INITIATIVE, new Pattern(new ResourceLocation(TardisRefined.MODID, "blue"), "initiative/initiative_console_blue"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
import net.minecraft.world.level.Level;
import whocraft.tardis_refined.TardisRefined;
import whocraft.tardis_refined.client.TardisClientData;
import whocraft.tardis_refined.common.block.console.GlobalConsoleBlock;
import whocraft.tardis_refined.common.blockentity.console.GlobalConsoleBlockEntity;
import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme;

import java.util.List;
import java.util.Set;

public class CoralConsoleModel extends HierarchicalModel implements ConsoleUnit {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import whocraft.tardis_refined.TardisRefined;
import whocraft.tardis_refined.common.block.console.GlobalConsoleBlock;
import whocraft.tardis_refined.common.blockentity.console.GlobalConsoleBlockEntity;
import net.minecraft.world.level.Level;
import whocraft.tardis_refined.client.TardisClientData;
import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme;

import java.util.List;

public class FactoryConsoleModel extends HierarchicalModel implements ConsoleUnit {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package whocraft.tardis_refined.client.model.blockentity.console;

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level;
import whocraft.tardis_refined.common.block.console.GlobalConsoleBlock;
import whocraft.tardis_refined.common.blockentity.console.GlobalConsoleBlockEntity;
import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme;

public interface IConsoleUnit {
void renderConsole(GlobalConsoleBlockEntity globalConsoleBlock, Level level, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, int packedOverlay, float red, float green, float blue, float alpha);

default ResourceLocation getTexture(GlobalConsoleBlockEntity entity) {

if (entity == null) return getDefaultTexture();

ConsoleTheme console = entity.getBlockState().getValue(GlobalConsoleBlock.CONSOLE);
return entity.pattern().textureLocation();
}
ResourceLocation getDefaultTexture();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;

import net.minecraft.resources.ResourceLocation;

import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;

import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.context.BlockPlaceContext;
Expand All @@ -29,8 +26,8 @@
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import whocraft.tardis_refined.client.TardisClientData;
import whocraft.tardis_refined.TardisRefined;
import whocraft.tardis_refined.client.TardisClientData;
import whocraft.tardis_refined.client.model.blockentity.console.ConsolePatterns;
import whocraft.tardis_refined.common.block.properties.ConsoleProperty;
import whocraft.tardis_refined.common.blockentity.console.GlobalConsoleBlockEntity;
Expand Down Expand Up @@ -119,20 +116,20 @@ public void animateTick(BlockState blockState, Level level, BlockPos blockPos, R

if (clientData.isFlying() && level.random.nextInt(4) == 0) {

ClientHelper.playParticle((ClientLevel) level, ParticleTypes.CLOUD, new Vec3( xCord, yCord, zCord), 0.0D, 0.1D, 0.0D);
ClientHelper.playParticle((ClientLevel) level, ParticleTypes.CLOUD, new Vec3(xCord, yCord, zCord), 0.0D, 0.1D, 0.0D);
}

if (clientData.isOnCooldown() || clientData.isCrashing()) {

ClientHelper.playParticle((ClientLevel) level, ParticleTypes.CAMPFIRE_COSY_SMOKE, new Vec3( xCord, yCord, zCord), 0.0D, 0.1D, 0.0D);
ClientHelper.playParticle((ClientLevel) level, ParticleTypes.CAMPFIRE_COSY_SMOKE, new Vec3(xCord, yCord, zCord), 0.0D, 0.1D, 0.0D);

for (int i = 0; i < 5; i++) {
ClientHelper.playParticle((ClientLevel) level, ParticleTypes.LARGE_SMOKE, new Vec3( xCord, yCord, zCord), 0.0D, 0.1D, 0.0D);
ClientHelper.playParticle((ClientLevel) level, ParticleTypes.LARGE_SMOKE, new Vec3(xCord, yCord, zCord), 0.0D, 0.1D, 0.0D);
}

if (level.random.nextInt(10) == 0) {
for (int i = 0; i < 3; i++) {
ClientHelper.playParticle((ClientLevel) level, ParticleTypes.LAVA,new Vec3( xCord, yCord, zCord), -0.5 + level.random.nextFloat(), 0.05D, -0.5 + level.random.nextFloat());
ClientHelper.playParticle((ClientLevel) level, ParticleTypes.LAVA, new Vec3(xCord, yCord, zCord), -0.5 + level.random.nextFloat(), 0.05D, -0.5 + level.random.nextFloat());
}

level.playLocalSound(blockPos.getX(), blockPos.getY(), blockPos.getZ(), SoundEvents.LAVA_EXTINGUISH, SoundSource.BLOCKS, 1, level.getRandom().nextFloat() + 1f, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mojang.math.Vector3f;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
Expand Down Expand Up @@ -81,6 +80,7 @@ public void load(CompoundTag tag) {
}

super.load(tag);

spawnControlEntities();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class ItemRegistry {

public static final RegistrySupplier<Item> KEY = ITEMS.register("tardis_key", () -> new KeyItem(new Item.Properties().stacksTo(1).tab(MAIN_TAB)));
public static final RegistrySupplier<Item> PATTERN_MANIPULATOR = ITEMS.register("pattern_manipulator", () -> new Item(new Item.Properties().stacksTo(1).tab(MAIN_TAB)));

public static final RegistrySupplier<Item> DRILL = ITEMS.register("drill", () -> new DrillItem(new Item.Properties().stacksTo(1).tab(MAIN_TAB)));


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class SoundRegistry {
public static final RegistrySupplier<SoundEvent> TARDIS_CRASH_LAND = setUpSound("tardis_crash_land");
public static final RegistrySupplier<SoundEvent> PATTERN_MANIPULATOR = setUpSound("pattern_manipulator");


private static RegistrySupplier<SoundEvent> setUpSound(String soundName) {
SoundEvent sound = new SoundEvent(new ResourceLocation(TardisRefined.MODID, soundName));
return SOUNDS.register(soundName, () -> sound);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public void registerSounds() {
add(SoundRegistry.TARDIS_LAND.get(), basicSound("tardis_land", new ResourceLocation(TardisRefined.MODID, "tardis/tardis_land")));
add(SoundRegistry.TARDIS_SINGLE_FLY.get(), basicSound("tardis_single_fly", new ResourceLocation(TardisRefined.MODID, "tardis/tardis_single_fly")));
add(SoundRegistry.TARDIS_TAKEOFF.get(), basicSound("tardis_takeoff", new ResourceLocation(TardisRefined.MODID, "tardis/tardis_takeoff")));
add(SoundRegistry.PATTERN_MANIPULATOR.get(), basicSound("pattern_manipulator", new ResourceLocation(TardisRefined.MODID, "gadgets/pattern_manipulator")));
add(SoundRegistry.TIME_BLAST.get(), basicSound("time_blast", new ResourceLocation(TardisRefined.MODID, "tardis/time_blast")));
add(SoundRegistry.TARDIS_CRASH_LAND.get(), basicSound("tardis_crash_land", new ResourceLocation(TardisRefined.MODID, "tardis/tardis_crash_land")));
add(SoundRegistry.PATTERN_MANIPULATOR.get(), basicSound("pattern_manipulator", new ResourceLocation(TardisRefined.MODID, "gadgets/pattern_manipulator")));
}

public SoundDefinition basicSound(SoundEvent soundEvent) {
Expand Down