Skip to content

Commit

Permalink
Update trashcan collision to match new appearance
Browse files Browse the repository at this point in the history
Add loading overlay, disabled for now.
  • Loading branch information
UnlikePaladin committed Sep 30, 2024
1 parent 2fdb53f commit 1172497
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.MODEL;
}

public static final VoxelShape TRASHCAN = VoxelShapes.union(createCuboidShape(2, 0, 2, 13, 13, 13), createCuboidShape(1, 12, 1, 14, 16, 14), createCuboidShape(3.5, 16, 6.5,11.5, 18, 8.5));
public static final VoxelShape TRASHCAN = VoxelShapes.union(createCuboidShape(2, 0, 2, 13, 13, 13), createCuboidShape(1, 12, 1, 14, 15, 14), createCuboidShape(3.5, 14.9, 6.5,11.5, 16, 8.5));
public static final VoxelShape TRASHCAN_OPEN = VoxelShapes.union(createCuboidShape(2, 0, 2, 13, 13, 13), createCuboidShape(10.5, 0, 0, 19.5, 13, 14));

@Override
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.collect.ImmutableList;
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.client.screens.PFMConfigScreen;
import com.unlikepaladin.pfm.client.screens.PFMGeneratingOverlay;
import com.unlikepaladin.pfm.config.option.AbstractConfigOption;
import com.unlikepaladin.pfm.config.option.BooleanConfigOption;
import com.unlikepaladin.pfm.config.option.Side;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import com.google.common.base.Stopwatch;
import com.mojang.bridge.game.PackType;
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.client.screens.PFMGeneratingOverlay;
import com.unlikepaladin.pfm.runtime.assets.PFMBlockstateModelProvider;
import com.unlikepaladin.pfm.runtime.assets.PFMLangProvider;
import com.unlikepaladin.pfm.runtime.data.PFMMCMetaProvider;
import com.unlikepaladin.pfm.utilities.PFMFileUtil;
import net.minecraft.client.MinecraftClient;
import net.minecraft.data.DataCache;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourceType;
Expand All @@ -26,11 +28,12 @@ public class PFMAssetGenerator extends PFMGenerator {

public PFMAssetGenerator(Path output, boolean logOrDebug) {
super(output, logOrDebug, LogManager.getLogger("PFM-Asset-Generation"));
count = 0;
count = 3;
}

public void run() throws IOException {
if (!FROZEN) {
count = 0;
setAssetsRunning(true);
log("Packs:");
for (ResourcePack pack : PFMRuntimeResources.RESOURCE_PACK_LIST) {
Expand All @@ -55,6 +58,7 @@ public void run() throws IOException {
List<String> oldHash = Files.readAllLines(hashPath);
List<String> modList = Files.readAllLines(modListPath);
if (!hashToCompare.toString().equals(oldHash.toString()) || !modList.toString().replace("[", "").replace("]", "").equals(PaladinFurnitureMod.getVersionMap().toString())) {
//MinecraftClient.getInstance().setOverlay(new PFMGeneratingOverlay(MinecraftClient.getInstance().getOverlay(), this, MinecraftClient.getInstance(), true));
getLogger().info("Starting PFM Asset Generation");
PFMFileUtil.deleteDir(output.toFile());
PFMRuntimeResources.createDirIfNeeded(output);
Expand Down Expand Up @@ -105,8 +109,8 @@ public void run() throws IOException {
}

@Override
public int getProgress() {
return count / 3;
public float getProgress() {
return (float) count / 3;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import com.google.common.hash.HashCode;
import com.mojang.bridge.game.PackType;
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.client.screens.PFMGeneratingOverlay;
import com.unlikepaladin.pfm.runtime.assets.PFMBlockstateModelProvider;
import com.unlikepaladin.pfm.runtime.assets.PFMLangProvider;
import com.unlikepaladin.pfm.runtime.data.PFMLootTableProvider;
import com.unlikepaladin.pfm.runtime.data.PFMMCMetaProvider;
import com.unlikepaladin.pfm.runtime.data.PFMRecipeProvider;
import com.unlikepaladin.pfm.runtime.data.PFMTagProvider;
import com.unlikepaladin.pfm.utilities.PFMFileUtil;
import net.minecraft.client.MinecraftClient;
import net.minecraft.data.DataCache;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourceType;
Expand All @@ -29,9 +31,11 @@ public class PFMDataGenerator extends PFMGenerator {

public PFMDataGenerator(Path output, boolean logOrDebug) {
super(output, logOrDebug, LogManager.getLogger("PFM-DataGen"));
count = 4;
}
public void run() throws IOException {
if (!FROZEN) {
count = 0;
setDataRunning(true);
log("Packs:");
for (ResourcePack pack : PFMRuntimeResources.RESOURCE_PACK_LIST) {
Expand All @@ -56,6 +60,7 @@ public void run() throws IOException {
List<String> modList = Files.readAllLines(modListPath);
if (!hashToCompare.toString().equals(oldHash.toString()) || !modList.toString().replace("[", "").replace("]", "").equals(PaladinFurnitureMod.getVersionMap().toString())) {
getLogger().info("Starting PFM Data Generation");
//MinecraftClient.getInstance().setOverlay(new PFMGeneratingOverlay(MinecraftClient.getInstance().getOverlay(), this, MinecraftClient.getInstance(), true));
PFMFileUtil.deleteDir(output.toFile());
DataCache dataCache = new DataCache(output, "cache");
dataCache.ignore(output.resolve("version.json"));
Expand Down Expand Up @@ -113,8 +118,8 @@ public void run() throws IOException {
}

@Override
public int getProgress() {
return count / 4;
public float getProgress() {
return (float) count / 4;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.unlikepaladin.pfm.runtime;

public interface PFMResourceProgress {
int getProgress();
float getProgress();

String getProgressString();
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.unlikepaladin.pfm.runtime;

import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.client.screens.PFMGeneratingOverlay;
import com.unlikepaladin.pfm.utilities.PFMFileUtil;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.ModelBakeSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.resource.DirectoryResourcePack;
import net.minecraft.resource.ResourcePack;
import net.minecraft.util.Identifier;
Expand All @@ -15,12 +15,13 @@
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;

public class PFMRuntimeResources {
public static final String base64Icon = "/9j/4AAQSkZJRgABAQAASABIAAD/2wBDABwcHBwcHDAcHDBEMDAwRFxEREREXHRcXFxcXHSMdHR0dHR0jIyMjIyMjIyoqKioqKjExMTExNzc3Nzc3Nzc3Nz/2wBDASIkJDg0OGA0NGDmnICc5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ub/wAARCAEAAQADASIAAhEBAxEB/8QAGQABAAMBAQAAAAAAAAAAAAAAAAEDBAUC/8QAKBABAQABAwQBBAIDAQAAAAAAAAECAxExBCEycVESIjNBYYETkaGx/8QAGAEBAAMBAAAAAAAAAAAAAAAAAAEDBAL/xAAcEQEBAAMBAQEBAAAAAAAAAAAAAQIDETEhUUH/2gAMAwEAAhEDEQA/ANADG2gAAAAAAAAAAAAAAt/w6n0/V9NVFliJZfAASAAAAAAAAAAAAAAAAAAAAAAAADRp9Nnn3y+2Nuno4afE7/LvHXary2SMWn02effL7Y26ejhp8Tv8rkWxdjhIpyztSo1NLTz5ndbvUOrHMci9rshN5qGRrABIAAAAAAAAAAAAAAAAAANGn02efe/bG3DRw0+J3+XeOu1XlskYsOmzz737Y26ejhp8Tv8AK5FsXY4SKcs7UotkRah05TbUAkAEJci81CbzUMjUACQAAAAAAAAAAAAAAABM5iEzmEQ6szs/l7mUsUveLWy2PdqASgAAAAAQlyLzUJvNQyNQAJAAAAAAAAAAAAAAAAEzmITOYRDpPeLw94tbNXoBLkAAAAAQlyLzUJvNQyNQAJAAAAAAAAAAAAAAAAEzmITOYRDpPeLw94tbNXoBLkAAAAAQlyLzUJvNQyNQAJAAAAAAAAAAAAAAAAEzmITOYRDpPeLw94tbNXoBLkAAAAAQ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AAu0LJld7tvFImXl6izs46aycOZjqZYcXt8Lr1N22xm1XTZFNwrVqZTHG73bs5ablcrvld0Ks8urMMeADl2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//2Q==";

public static final DirectoryResourcePack ASSETS_PACK = new DirectoryResourcePack(getAssetPackDirectory().toFile());
public static final DirectoryResourcePack DATA_PACK = new DirectoryResourcePack(getDataPackDirectory().toFile());

Expand Down Expand Up @@ -56,8 +57,8 @@ public static Path createDirIfNeeded(Path path) {

private static CompletableFuture<Void> future;
public static CompletableFuture<Void> prepareAsyncDataGen(boolean logOrDebug) {
PFMDataGenerator dataGen = new PFMDataGenerator(PFMRuntimeResources.getDataPackDirectory(), logOrDebug);
return future = CompletableFuture.runAsync(() -> {
PFMDataGenerator dataGen = new PFMDataGenerator(PFMRuntimeResources.getDataPackDirectory(), logOrDebug);
try {
dataGen.run();
} catch (IOException e) {
Expand All @@ -68,8 +69,8 @@ public static CompletableFuture<Void> prepareAsyncDataGen(boolean logOrDebug) {
}

public static CompletableFuture<Void> prepareAsyncAssetGen(boolean logOrDebug) {
PFMAssetGenerator dataGen = new PFMAssetGenerator(PFMRuntimeResources.getAssetPackDirectory(), logOrDebug);
return future = CompletableFuture.runAsync(() -> {
PFMAssetGenerator dataGen = new PFMAssetGenerator(PFMRuntimeResources.getAssetPackDirectory(), logOrDebug);
try {
dataGen.run();
} catch (IOException e) {
Expand Down

0 comments on commit 1172497

Please sign in to comment.