Skip to content

Commit

Permalink
Merge pull request #129 from ScicraftLearn/Versioning
Browse files Browse the repository at this point in the history
Versioning
  • Loading branch information
smtdm authored Jul 14, 2022
2 parents 6c9278f + 43c4623 commit 1042f7a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 47 deletions.
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -16,22 +16,19 @@ repositories {
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {
name = "WTHIT"
url = "https://maven.bai.lol"
}
//maven { url "https://maven.bai.lol" }
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modRuntime "mcp.mobius.waila:wthit:fabric-${project.wthit_version}"
//modRuntimeOnly "mcp.mobius.waila:wthit:fabric-${project.wthitVersion}"
//modRuntimeOnly "lol.bai:badpackets:fabric-0.1.2"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompileOnly "mcp.mobius.waila:wthit-api:fabric-${project.wthit_version}"
}

processResources {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.9
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
# Mod Properties
mod_version=1.0.0
maven_group=be.uantwepren
archives_base_name=Scicraft
# Dependencies
fabric_version=0.44.0+1.18
wthit_version=4.3.0
fabric_version=0.57.0+1.19
wthit_version=5.5.1
16 changes: 9 additions & 7 deletions src/main/java/be/uantwerpen/scicraft/paintings/Paintings.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
package be.uantwerpen.scicraft.paintings;

import be.uantwerpen.scicraft.Scicraft;
import net.minecraft.entity.decoration.painting.PaintingMotive;
import net.minecraft.entity.decoration.painting.PaintingVariant;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;

public class Paintings {

public static final PaintingMotive PARTICLE_CPY = register(new PaintingMotive(32, 32), "particle_cpy");
public static final PaintingMotive PARTICLE_RGB = register(new PaintingMotive(32, 32), "particle_rgb");
public static final RegistryKey<PaintingVariant> PARTICLE_CPY = register("particle_cpy", new PaintingVariant(32, 32));
public static final RegistryKey<PaintingVariant> PARTICLE_RGB = register("particle_rgb", new PaintingVariant(32, 32));

/**
* Register a new painting
*
* @param motive : new painting
* @param id : string name of painting
* @return {@link PaintingMotive}
* @return {@link PaintingVariant}
*/
private static PaintingMotive register(PaintingMotive motive, String id) {
return Registry.register(Registry.PAINTING_MOTIVE, new Identifier(Scicraft.MOD_ID, id), motive);
private static RegistryKey<PaintingVariant> register(String id, PaintingVariant motive) {
RegistryKey<PaintingVariant> key = RegistryKey.of(Registry.PAINTING_VARIANT_KEY, new Identifier(Scicraft.MOD_ID, id));
Registry.register(Registry.PAINTING_VARIANT, key, motive);
return key;
}

public static void registerPaintings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.world.World;

import java.util.Random;

@Environment(EnvType.CLIENT)
public class ChargedBlockEntityRenderer<T extends AnimatedChargedBlockEntity> implements BlockEntityRenderer<T> {

Expand Down Expand Up @@ -51,8 +49,7 @@ public void render(T blockEntity, float tickDelta, MatrixStack matrices, VertexC
blockEntity.getPos(),
matrices,
vertexConsumerProvider.getBuffer(RenderLayers.getMovingBlockLayer(blockEntity.render_state)),
false,
new Random(),
false, net.minecraft.util.math.random.Random.create(),
blockEntity.render_state.getRenderingSeed(blockEntity.getPos()),
OverlayTexture.DEFAULT_UV);
}
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/be/uantwerpen/scicraft/util/Tags.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package be.uantwerpen.scicraft.util;

import be.uantwerpen.scicraft.Scicraft;
import net.fabricmc.fabric.api.tag.TagFactory;
import net.minecraft.block.Block;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

/**
* Use these tags for NEW tags.
Expand All @@ -18,29 +18,29 @@
public class Tags {
public static class Blocks {

public static final Tag<Block> COPPER_BLOCKS = createTag("copper_blocks");
public static final Tag<Block> CHARGED_BLOCKS = createTag("charged_blocks");
public static final TagKey<Block> COPPER_BLOCKS = createTag("copper_blocks");
public static final TagKey<Block> CHARGED_BLOCKS = createTag("charged_blocks");

/**
* Create a Block tag (tag is only used inside this mod)
* Don't forget the json file (data/scicraft/tags/blocks)
*
* @param name : name of the tag
* @return {@link Tag}
* @return {@link TagKey}
*/
private static Tag<Block> createTag(String name) {
return TagFactory.BLOCK.create(new Identifier(Scicraft.MOD_ID, name));
private static TagKey<Block> createTag(String name) {
return TagKey.of(Registry.BLOCK_KEY, new Identifier(Scicraft.MOD_ID, name));
}

/**
* Create a Block tag (tag for usage outside this mod)
* Don't forget the json file (data/c/tags/blocks)
*
* @param name : name of the tag
* @return {@link Tag}
* @return {@link TagKey}
*/
private static Tag<Block> createCommonTag(String name) {
return TagFactory.BLOCK.create(new Identifier("c", name));
private static TagKey<Block> createCommonTag(String name) {
return TagKey.of(Registry.BLOCK_KEY, new Identifier("c", name));
}
}

Expand All @@ -51,21 +51,21 @@ public static class Items {
* Don't forget the json file (data/scicraft/tags/items)
*
* @param name : name of the tag
* @return {@link Tag}
* @return {@link TagKey}
*/
private static Tag<Item> createTag(String name) {
return TagFactory.ITEM.create(new Identifier(Scicraft.MOD_ID, name));
private static TagKey<Item> createTag(String name) {
return TagKey.of(Registry.ITEM_KEY, new Identifier("c", name));
}

/**
* Create an Item tag (tag for usage outside this mod)
* Don't forget the json file (data/c/tags/items)
*
* @param name : name of the tag
* @return {@link Tag}
* @return {@link TagKey}
*/
private static Tag<Item> createCommonTag(String name) {
return TagFactory.ITEM.create(new Identifier("c", name));
private static TagKey<Item> createCommonTag(String name) {
return TagKey.of(Registry.ITEM_KEY, new Identifier("c", name));
}
}

Expand All @@ -76,21 +76,21 @@ public static class Fluids {
* Don't forget the json file (data/scicraft/tags/fluids)
*
* @param name : name of the tag
* @return {@link Tag}
* @return {@link TagKey}
*/
private static Tag<Fluid> createTag(String name) {
return TagFactory.FLUID.create(new Identifier(Scicraft.MOD_ID, name));
private static TagKey<Fluid> createTag(String name) {
return TagKey.of(Registry.FLUID_KEY, new Identifier("c", name));
}

/**
* Create a Fluid tag (tag for usage outside this mod)
* Don't forget the json file (data/c/tags/fluids)
*
* @param name : name of the tag
* @return {@link Tag}
* @return {@link TagKey}
*/
private static Tag<Fluid> createCommonTag(String name) {
return TagFactory.FLUID.create(new Identifier("c", name));
private static TagKey<Fluid> createCommonTag(String name) {
return TagKey.of(Registry.FLUID_KEY, new Identifier("c", name));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"scicraft:particle_cpy",
"scicraft:particle_rgb"
]
}
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"scicraft.mixins.json"
],
"depends": {
"fabricloader": ">=0.11.7",
"fabricloader": ">=0.14.8",
"fabric": "*",
"minecraft": "1.18.x",
"minecraft": "1.19.x",
"java": ">=17"
}
}

0 comments on commit 1042f7a

Please sign in to comment.