-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
335 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ko_fi: Patbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/loom-cache | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
gradle- | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build and publish with Gradle | ||
run: ./gradlew build publish | ||
env: | ||
MODRINTH: ${{ secrets.MODRINTH }} | ||
CHANGELOG: ${{ github.event.release.body }} | ||
RELEASE: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Polymer Patch for Anshar | ||
This mod is a patch/addon to [Anshar by hama Industries](https://modrinth.com/mod/anshar), allowing it to function purely server side. | ||
Anshar mod is required and not included within this mod. | ||
|
||
[You can read more about Anshar on it's Modrinth page!](https://modrinth.com/mod/anshar) | ||
|
||
## [== Download on Modrinth ==](https://modrinth.com/project/anshar-polymer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/eu/pb4/ansharpatch/mixin/EntityStatusS2CPacketAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package eu.pb4.ansharpatch.mixin; | ||
|
||
import net.minecraft.network.packet.s2c.play.EntityStatusS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(EntityStatusS2CPacket.class) | ||
public interface EntityStatusS2CPacketAccessor { | ||
@Accessor | ||
int getId(); | ||
|
||
@Mutable | ||
@Accessor | ||
void setId(int id); | ||
|
||
@Accessor | ||
byte getStatus(); | ||
|
||
@Mutable | ||
@Accessor | ||
void setStatus(byte status); | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/eu/pb4/ansharpatch/mixin/FileResourcePackProviderAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package eu.pb4.ansharpatch.mixin; | ||
|
||
import net.minecraft.resource.FileResourcePackProvider; | ||
import net.minecraft.resource.ResourcePackSource; | ||
import net.minecraft.resource.ResourceType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(FileResourcePackProvider.class) | ||
public interface FileResourcePackProviderAccessor { | ||
|
||
@Accessor | ||
ResourcePackSource getSource(); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/eu/pb4/ansharpatch/mixin/FireworkRocketEntityAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package eu.pb4.ansharpatch.mixin; | ||
|
||
import net.minecraft.entity.data.TrackedData; | ||
import net.minecraft.entity.projectile.FireworkRocketEntity; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(FireworkRocketEntity.class) | ||
public interface FireworkRocketEntityAccessor { | ||
@Accessor | ||
static TrackedData<ItemStack> getITEM() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/eu/pb4/ansharpatch/mixin/ResourcePackManagerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package eu.pb4.ansharpatch.mixin; | ||
|
||
import eu.pb4.ansharpatch.pack.LangPackProvider; | ||
import net.minecraft.resource.*; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.util.LinkedHashSet; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
@Mixin(ResourcePackManager.class) | ||
public abstract class ResourcePackManagerMixin { | ||
|
||
@Shadow | ||
@Final | ||
@Mutable | ||
public Set<ResourcePackProvider> providers; | ||
|
||
@Inject(method = "<init>", at = @At("RETURN")) | ||
public void injectCustom(ResourcePackProvider[] resourcePackProviders, CallbackInfo info) { | ||
providers = new LinkedHashSet<>(providers); | ||
|
||
// Search resource pack providers to find any server-related pack provider. | ||
boolean shouldAddServerProvider = false; | ||
|
||
for (ResourcePackProvider provider : this.providers) { | ||
if (provider instanceof FileResourcePackProvider | ||
&& (((FileResourcePackProviderAccessor) provider).getSource() == ResourcePackSource.WORLD | ||
|| ((FileResourcePackProviderAccessor) provider).getSource() == ResourcePackSource.SERVER)) { | ||
shouldAddServerProvider = true; | ||
break; | ||
} | ||
} | ||
|
||
// On server, add the mod resource pack provider. | ||
if (shouldAddServerProvider) { | ||
providers.add(LangPackProvider.INSTANCE); | ||
} | ||
} | ||
} |
Oops, something went wrong.