Skip to content

Commit

Permalink
update for minecraft 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Aug 25, 2023
1 parent 37b47b0 commit d483410
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: projector-1.3.0.jar
path: ./build/libs/projector-1.3.0.jar
name: projector-1.4.0.jar
path: ./build/libs/projector-1.4.0.jar
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ bin/
# fabric

run/
.fabric
logs/
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
}

Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.19
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22

# Mod Properties
mod_version = 1.3.0
mod_version = 1.4.0
maven_group = com.github.hashicraft
archives_base_name = projector

# Dependencies
fabric_version=0.81.1+1.19.4
libgui_version=7.0.1+1.19.4
stateful_version=v1.2.0
fabric_version=0.87.0+1.20.1
libgui_version=8.0.2+1.20
stateful_version=v1.3.0
14 changes: 10 additions & 4 deletions src/main/java/com/github/hashicraft/projector/ProjectorMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

public class ProjectorMod implements ModInitializer {
Expand All @@ -33,13 +35,13 @@ public class ProjectorMod implements ModInitializer {
public static final Identifier DISPLAY_ID = identifier("display");
public static final Identifier PLACEHOLDER_TEXTURE = identifier("textures/block/display_placeholder.png");

public static final Block DISPLAY = new Display(FabricBlockSettings.of(Material.METAL).strength(4.0f).nonOpaque());
public static final Block DISPLAY = new Display(FabricBlockSettings.create().strength(4.0f).nonOpaque().solid());

public static final Item REMOTE_ITEM = new Remote(new Item.Settings());
public static final Item DISPLAY_ITEM = new BlockItem(DISPLAY, new Item.Settings());

public static final ItemGroup ITEM_GROUP = FabricItemGroup.builder(identifier("general")).icon(
() -> new ItemStack(DISPLAY)).build();
public static final RegistryKey<ItemGroup> ITEM_GROUP = RegistryKey.of(RegistryKeys.ITEM_GROUP,
new Identifier(MODID, "general"));

public static Item REMOTE;
public static BlockEntityType<DisplayEntity> DISPLAY_ENTITY;
Expand All @@ -48,6 +50,10 @@ public class ProjectorMod implements ModInitializer {
public void onInitialize() {
Registry.register(Registries.BLOCK, DISPLAY_ID, DISPLAY);
Registry.register(Registries.ITEM, DISPLAY_ID, DISPLAY_ITEM);
Registry.register(Registries.ITEM_GROUP, ITEM_GROUP, FabricItemGroup.builder()
.icon(() -> new ItemStack(DISPLAY))
.displayName(Text.translatable("projector.display"))
.build());

REMOTE = Registry.register(Registries.ITEM, REMOTE_ID, REMOTE_ITEM);
DISPLAY_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, DISPLAY_ID,
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"projector.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.19",
"fabricloader": ">=0.14.22",
"fabric": "*",
"minecraft": "~1.19.4",
"minecraft": "~1.20.1",
"java": ">=17"
}
}

0 comments on commit d483410

Please sign in to comment.