Skip to content

Commit

Permalink
Initial 1.17 port
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed May 29, 2021
1 parent 05003e1 commit a9c1b53
Show file tree
Hide file tree
Showing 23 changed files with 111 additions and 260 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
matrix:
# Use these Java versions
java: [
1.8, # Minimum supported by Minecraft
11, # Current Java LTS
15 # Latest version
16 # Latest version
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-latest]
Expand All @@ -34,7 +32,7 @@ jobs:
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 16

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
15 changes: 6 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'fabric-loom' version '0.6-SNAPSHOT'
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
}

def env = System.getenv()

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand All @@ -21,7 +21,6 @@ repositories {

maven { url "https://jitpack.io" }
maven { url = "https://maven.nucleoid.xyz/" }
//maven { url = "https://maven.tomthegeek.ml" }
mavenLocal()
}

Expand Down Expand Up @@ -66,7 +65,7 @@ dependencies {
exclude module: 'artifice'
}

modImplementation include("fr.catcore:server-translations-api:1.4.1")
//modImplementation include("fr.catcore:server-translations-api:1.4.1")

// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
Expand All @@ -91,10 +90,8 @@ tasks.withType(JavaCompile).configureEach {
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}

it.options.release = 16
}

java {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.6
minecraft_version=1.17-pre1
yarn_mappings=1.17-pre1+build.1
loader_version=0.11.3

# Mod Properties
mod_version = 0.0.3
mod_version = 0.1.0-pre0
maven_group = eu.pb4
archives_base_name = polymer

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.32.5+1.16
fabric_version=0.34.8+1.17
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
20 changes: 10 additions & 10 deletions src/main/java/eu/pb4/polymer/block/VirtualHeadBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
import net.minecraft.server.network.ServerPlayerEntity;
Expand All @@ -28,13 +28,13 @@ default Block getVirtualBlock() {
* Creates tag of Skull block entity
*
* @param state Server-side BlockState
* @return CompoundTag representing client-side
* @return NbtCompound representing client-side
*/
default CompoundTag getVirtualHeadSkullOwner(BlockState state) {
CompoundTag skullOwner = new CompoundTag();
CompoundTag properties = new CompoundTag();
CompoundTag data = new CompoundTag();
ListTag textures = new ListTag();
default NbtCompound getVirtualHeadSkullOwner(BlockState state) {
NbtCompound skullOwner = new NbtCompound();
NbtCompound properties = new NbtCompound();
NbtCompound data = new NbtCompound();
NbtList textures = new NbtList();
textures.add(data);

data.putString("Value", ((VirtualHeadBlock) state.getBlock()).getVirtualHeadSkin(state));
Expand All @@ -53,8 +53,8 @@ default CompoundTag getVirtualHeadSkullOwner(BlockState state) {
* @return A Packet
*/
default Packet<?> getVirtualHeadPacket(BlockState state, BlockPos pos) {
CompoundTag main = new CompoundTag();
CompoundTag skullOwner = this.getVirtualHeadSkullOwner(state);
NbtCompound main = new NbtCompound();
NbtCompound skullOwner = this.getVirtualHeadSkullOwner(state);
main.putString("id", "minecraft:skull");
main.put("SkullOwner", skullOwner);
main.putInt("x", pos.getX());
Expand Down
Loading

0 comments on commit a9c1b53

Please sign in to comment.