Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f6828ec
allowed the use of M1 chips
vaylor27 Sep 10, 2023
8194111
add model and block generation for fossils based on a config | add mixin
vaylor27 Sep 16, 2023
e8b2baf
remove missing @see in javadoc
vaylor27 Sep 16, 2023
bbf30a7
use parchment mappings
vaylor27 Sep 16, 2023
8b5dd41
make fossil items have an overlay | remove debug print statements
vaylor27 Sep 16, 2023
cda8fdc
tint fossil item overlays and add translations
vaylor27 Sep 16, 2023
4fb8219
add an API and use it to register the default stuff | fix a crash on …
vaylor27 Sep 16, 2023
341df8e
use transparent textures instead of tinting
vaylor27 Sep 17, 2023
6d26a47
add FossilCondition
vaylor27 Sep 17, 2023
e1dd3be
better translation
vaylor27 Sep 17, 2023
73e93e2
add FossilType
vaylor27 Sep 18, 2023
f6be425
add a fossil pouch – automatically picks up fossils
vaylor27 Sep 19, 2023
9736d95
add new fossil cap and remove old fossil items and blocks
vaylor27 Sep 19, 2023
c007290
rename Time to DinosaurAge
vaylor27 Sep 19, 2023
a399782
fix typos I came across
vaylor27 Sep 19, 2023
332827a
add new fossil textures
vaylor27 Sep 20, 2023
98cc5b2
switch bus to mod so events get fired
vaylor27 Sep 20, 2023
17f37ba
make ITEMS and BLOCKS multimaps
vaylor27 Sep 20, 2023
3656c83
choosing random fossil tiers and types
vaylor27 Sep 20, 2023
2e75922
make fossils blockentites and store tier and type in them
vaylor27 Sep 20, 2023
ef2bb5a
set fossil tiers and types in a better way
vaylor27 Sep 20, 2023
9dd5da0
add TODO
vaylor27 Sep 21, 2023
6ceb420
move textures
vaylor27 Sep 23, 2023
f1a7d13
stitch textures to atlas
vaylor27 Sep 23, 2023
d7ccc6d
fix naming of fossil items
vaylor27 Sep 23, 2023
ee54d4b
add new baked model
vaylor27 Sep 23, 2023
a58999f
Start moving away from runtimepack and baked models
Wyn-Price Sep 23, 2023
4e4adee
Typo
Wyn-Price Sep 23, 2023
6df8a99
Actually render the overlay lol
Wyn-Price Sep 23, 2023
e7845d9
Reduce offset due to weird transparency sorting
Wyn-Price Sep 23, 2023
d8fd562
Start moving stone type and fossil to blockentity data
Wyn-Price Sep 24, 2023
f4442f5
Add dinosuar fossils
Wyn-Price Sep 24, 2023
6a4eef1
Move stone types to be a forge registry
Wyn-Price Sep 24, 2023
333c483
Fixup item models and cleanup old code
Wyn-Price Sep 24, 2023
3343ab3
Cleanup rendering and bad references
Wyn-Price Sep 24, 2023
f8bc6f5
remove useless todo
vaylor27 Sep 24, 2023
91de189
remove another useless todo
vaylor27 Sep 24, 2023
a32511c
change texture path layout
vaylor27 Sep 28, 2023
916e8c7
special rex fossils & add new baked model
vaylor27 Sep 28, 2023
8b09783
fix some compiler warnings and clear cache on reload
vaylor27 Sep 28, 2023
58c5060
texture picking based on tier & fix some fossils not having a texture
vaylor27 Sep 28, 2023
483037d
remove Fossils and move texture stitch event to ProjectNublar#onTextu…
vaylor27 Sep 29, 2023
c6d154b
crack textures
vaylor27 Sep 29, 2023
86c7ca5
Fix crack rendering and some general clenaup / bug fixes
Wyn-Price Sep 29, 2023
8b06830
fix some compiler warnings
vaylor27 Sep 29, 2023
107a263
fix some item models not rendering correctly
vaylor27 Sep 29, 2023
0a567d8
make my code suck less
vaylor27 Sep 29, 2023
00b7b64
remove ProjectNublar#getLogger and make logger public and final
vaylor27 Sep 29, 2023
4b4da45
save stuff to dropped fossils
vaylor27 Sep 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
buildscript {
repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net' }
maven { url = "https://plugins.gradle.org/m2/" }
mavenCentral()
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = 'https://maven.parchmentmc.org' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath "net.dumbcode.gradlehook:GradleHook:2.0.2"
classpath 'org.spongepowered:mixingradle:0.7.+'
classpath 'org.parchmentmc:librarian:1.+'
}
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: "net.dumbcode.gradlehook"
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'org.parchmentmc.librarian.forgegradle'

version = '1.16.5-' + (System.getenv("GITHUB_ACTIONS") ? System.getenv("GITHUB_RUN_NUMBER") : 'dev')
group = 'net.dumbcode.projectnublar' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand All @@ -30,8 +36,12 @@ sourceSets {
}
}

mixin {
add sourceSets.main, "projectnublar.refmap.json"
}

minecraft {
mappings channel: 'official', version: '1.16.5'
mappings channel: 'parchment', version: '2022.03.06-1.16.5'


accessTransformer(
Expand All @@ -44,7 +54,9 @@ minecraft {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'

property 'mixin.env.remapRefMap', 'true'
arg "-mixin.config=projectnublar.mixins.json"
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
projectnublar {
source sourceSets.main
Expand Down Expand Up @@ -101,10 +113,11 @@ repositories {
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.16.5-36.2.20'
minecraft 'net.minecraftforge:forge:1.16.5-36.2.34'

implementation 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'

Expand All @@ -125,7 +138,10 @@ jar {
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": 0,
"MixinConfigs": "projectnublar.mixins.json"
])
}
}
Expand All @@ -152,3 +168,4 @@ gradlehook {
addField 'payload_json', '{ "embeds": [{ "title":"' + System.getenv("COMMIT_MESSAGE") + " - " + System.getenv("COMMIT_AUTHOR") + '", "timestamp": "{{datetime}}" }] }'
addArtifact jar
}
apply from: "https://moddingtutorials.org/applesilicon.gradle"
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# Sets default memory used for gradle commands. Can be overridden by user or command line BlockStateProperties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mc_version=1.16.5
22 changes: 11 additions & 11 deletions machine_upgrades_stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
A list of all the currently updated machine parts
## Fossil Processor
### Tanks
Effects the capacity of the water tanks.
Affects the capacity of the water tanks.
- Default -> 2 buckets
- 1 -> 3 buckets
- 2 -> 4 buckets
### Computer Chip
Effects the time taken to convert fossil to genetic material .
Affects the time taken to convert fossil to genetic material .
- default -> 4 minutes
- 1 -> 3 minutes
- 2 -> 2 minutes
Expand All @@ -21,7 +21,7 @@ at full durability is the base efficiency, and at 0 durability is 25% of the bas
- Diamond -> 100% base efficiency, 500 durability
## Drill Extractor
### Drill Bit
Effects the time taken to convert amber into genetic material, and the rough amount of genetic material it produces.
Affects the time taken to convert amber into genetic material, and the rough amount of genetic material it produces.
- Default -> 6 minutes, ~1 genetic material
- 1 -> 5.5 minutes, ~2 genetic material
- 2 -> 5 minutes, ~3 genetic material
Expand All @@ -30,26 +30,26 @@ Effects the time taken to convert amber into genetic material, and the rough amo
- 5 -> 3.5 minutes, ~6 genetic material
## Sequencer
### Tanks
Effects the capacity of the water, bone, sugar and plant tanks. Water is measured in buckets while bone/sugar/plant
Affects the capacity of the water, bone, sugar and plant tanks. Water is measured in buckets while bone/sugar/plant
is measured in matter.
- Default -> 1 bucket, 16 matter
- 1 -> 1.5 bucket, 24 matter
- 2 -> 2 bucket, 32 matter
- 3 -> 2.5 bucket, 40 matter
- 4 -> 3 bucket, 48 matter
### Computer Chip
Effects the time taken to convert the water, bone, sugar, plant matter and selected dna values into a dna test tube.
Affects the time taken to convert the water, bone, sugar, plant matter and selected dna values into a dna test tube.
- Default -> 10 minutes
- 1 -> 7 minutes
- 2 -> 4 minutes
### Storage Type
The item used to store the data on. Gets put into the storage slot. Effects the time taken to convert a syringe or
The item used to store the data on. Gets put into the storage slot. Effects the dinosaurAge taken to convert a syringe or
genetic material into data and put the data into the storage item.
- hdd -> 10 seconds
- ssd -> 5 seconds
## 3D Printer
### Computer Chip
Effects the time taken to use embryo and bone meal and 3d print it into an artificial egg.
Affects the time taken to use embryo and bone meal and 3d print it into an artificial egg.
- Default -> 10 minutes
- 1 -> 8 minutes
- 2 -> 6 minutes
Expand All @@ -60,25 +60,25 @@ Adding this upgrade will remove the change of a broken egg occurring.
- 1 -> 0% chance
## Incubator
### Tanks
Effects the capacity of the plant matter tank.
Affects the capacity of the plant matter tank.
- Default -> 100 plant matter
- 1 -> 150 plant matter
- 2 -> 200 plant matter
### Bulb
Effects the time taken to incubate an egg.
Affects the time taken to incubate an egg.
- Default -> 30 minutes (18s per %)
- 1 -> 25 minutes (15s per %)
- 2 -> 20 minutes (12s per %)
- 3 -> 15 minutes (9s per %)
### Container
(needs renaming)
Effects the number of eggs that can be incubated at once on a single incubator.
Affects the number of eggs that can be incubated at once on a single incubator.
- Default -> 3 eggs
- 1 -> 6 eggs
- 2 -> 9 eggs
## Generator
### Turbines
Effects the amount of energy (FE) a tick from burning items.
Affects the amount of energy (FE) a tick from burning items.
- Default -> 2000
- 1 -> 3000
- 2 -> 4000
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
import static net.minecraft.client.renderer.RenderTypeLookup.setRenderLayer;
import static net.dumbcode.projectnublar.server.block.BlockHandler.*;

import net.dumbcode.dumblibrary.server.registry.RegistryMap;
import net.dumbcode.projectnublar.server.block.BlockHandler;
import net.dumbcode.projectnublar.server.block.FossilBlock;
import net.dumbcode.projectnublar.server.dinosaur.Dinosaur;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

import java.util.Arrays;
import java.util.HashSet;
Expand All @@ -23,12 +18,7 @@ public static void setRenderLayers() {

setRenderLayers(UNBUILT_INCUBATOR.get(), RenderType.solid(), RenderType.cutout(), RenderType.translucent());

for (RegistryMap<Dinosaur, FossilBlock> map : FOSSIL.values()) {
for (FossilBlock block : map.values()) {
setRenderLayers(block, RenderType.cutout());
}
}

setRenderLayers(FOSSIL_BLOCK.get(), RenderType.translucent(), RenderType.solid());
}

private static void setRenderLayers(Block block, RenderType... types) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
// zos.close();
// }
// } catch (IOException e) {
// ProjectNublar.getLogger().error("There was an issue serializing {}", infomation.getDinosaurLocation().getNamespace());
// ProjectNublar.LOGGER.error("There was an issue serializing {}", infomation.getDinosaurLocation().getNamespace());
// }
// }
// }
Expand Down Expand Up @@ -83,7 +83,7 @@
// lineNum++;
// }
// } catch (IOException e) {
// ProjectNublar.getLogger().error("Unable to load file" + e);
// ProjectNublar.LOGGER.error("Unable to load file" + e);
// }
// return new SkeletalBuilderFileInfomation(fileLocation, map);
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.dumbcode.dumblibrary.DumbLibrary;
import net.dumbcode.projectnublar.client.gui.tab.MachineContainerScreen;
import net.dumbcode.projectnublar.client.gui.tab.TabInformationBar;
import net.dumbcode.projectnublar.server.ProjectNublar;
import net.dumbcode.projectnublar.server.block.entity.EggPrinterBlockEntity;
import net.dumbcode.projectnublar.server.block.entity.IncubatorBlockEntity;
import net.dumbcode.projectnublar.server.block.entity.MachineModuleBlockEntity;
import net.dumbcode.projectnublar.server.containers.machines.MachineModuleContainer;
Expand Down Expand Up @@ -59,7 +57,7 @@ public IncubatorScreen(IncubatorBlockEntity blockEntity, MachineModuleContainer
try {
shaderManager = new ShaderInstance(Minecraft.getInstance().getResourceManager(), ProjectNublar.MODID + ":incubator_bed");
} catch (IOException e) {
ProjectNublar.getLogger().error("Unable to load incubator bed shader :/", e);
ProjectNublar.LOGGER.error("Unable to load incubator bed shader :/", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.NativeImage;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import org.lwjgl.PointerBuffer;
import org.lwjgl.system.MemoryStack;
Expand Down Expand Up @@ -85,7 +84,7 @@ public void initPage(int x, int y) {
try {
ProjectNublar.NETWORK.sendToServer(new CS2UploadPhotoBackgroundImage(!this.userTab, image.asByteArray()));
} catch (IOException e) {
ProjectNublar.getLogger().error("Unable to write image", e);
ProjectNublar.LOGGER.error("Unable to write image", e);
}
}));
this.uploadButton.active = this.currentTestImage != null;
Expand Down Expand Up @@ -203,7 +202,7 @@ private void setAsCurrent(Path path) {
this.currentTestImage = image;
this.uploadButton.active = true;
} catch (IOException e) {
ProjectNublar.getLogger().error("Unable to read file " + path.toAbsolutePath() + " as an image", e);
ProjectNublar.LOGGER.error("Unable to read file " + path.toAbsolutePath() + " as an image", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package net.dumbcode.projectnublar.client.model;

import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;

import java.util.Arrays;

import static java.lang.Float.floatToRawIntBits;
import static java.lang.Float.intBitsToFloat;

public class ModelUtils {

/**
* Retextures the quad to the atlas sprite, offset by a specific amount
* @param quad The original quad
* @param sprite The texture to replace
* @param offset The offset. Setting this to 0 will mean the quad will be at the exact same position
* as before, causing z-fighting if both quads are rendered. To fix this, apply a very small
* offset to physically move the vertexes the direction of the quad
* @return The new remapped quad
*/
public static BakedQuad retextureQuad(BakedQuad quad, TextureAtlasSprite sprite, float offset) {
int[] data = Arrays.copyOf(quad.getVertices(), quad.getVertices().length);
for (int i = 0; i < 4; i++) {
int j = DefaultVertexFormats.BLOCK.getIntegerSize() * i;

float x = intBitsToFloat(data[j]) + offset*quad.getDirection().getStepX();
float y = intBitsToFloat(data[j+1]) + offset*quad.getDirection().getStepY();
float z = intBitsToFloat(data[j+2]) + offset*quad.getDirection().getStepZ();

data[j] = floatToRawIntBits(x);
data[j+1] = floatToRawIntBits(y);
data[j+2] = floatToRawIntBits(z);

float ui;
float vi;

// This is figured out from trial and error, I think the discrepancy is due to
// weird vanilla axis-flipping behaviour
switch (quad.getDirection().getAxis()) {
case X:
ui = z;
vi = 1-y;
break;
case Y:
default:
ui = x;
vi = z;
break;
case Z:
ui = x;
vi = 1-y;
break;
}

data[j+4] = floatToRawIntBits(sprite.getU(ui*16F));
data[j+5] = floatToRawIntBits(sprite.getV(vi*16F));

data[j+6] = (240 << 16) | 240;
}

return new BakedQuad(data, -1, quad.getDirection(), sprite, quad.isShade());
}

}
Loading