Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.20' into 1.20.5
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
Patbox committed May 30, 2024
2 parents 4a78f4f + 3326a55 commit 43b43b5
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
run: ./gradlew downloadTranslations build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: chmod +x gradlew

- name: Build and publish with Gradle
run: ./gradlew build publish
run: ./gradlew downloadTranslations build publish
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
buildscript {
dependencies {
classpath "de.guntram.mcmod:crowdin-translate:1.4+1.19.3"
}
repositories {
maven {
name = 'CrowdinTranslate source'
url = "https://minecraft.guntram.de/maven/"
}
}
}

plugins {
id 'fabric-loom' version '1.6.+'
id 'maven-publish'
Expand All @@ -12,6 +24,13 @@ archivesBaseName = project.archives_base_name
version = project.mod_version + '+' + project.minecraft_version
group = project.maven_group

apply plugin: 'de.guntram.mcmod.crowdin-translate'
crowdintranslate.crowdinProjectName = 'patbox-mods'
crowdintranslate.jsonSourceName = 'armor_stand_editor'
crowdintranslate.minecraftProjectName = '../data/armor_stand_editor'
crowdintranslate.verbose = false


repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

minecraft_version=1.20.5-rc3
yarn_mappings=1.20.5-rc3+build.1
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.10

#Fabric api
fabric_version=0.97.3+1.20.5

# Mod Properties
mod_version = 2.4.0
mod_version = 2.4.1
maven_group = eu.pb4
archives_base_name = armor-stand-editor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,15 @@ public void onClose() {
public static void openItemFrameEditor(ServerPlayerEntity player, ItemFrameEntity entity) {
ItemFrameEntityAccessor ifa = (ItemFrameEntityAccessor) entity;

SimpleGui gui = new SimpleGui(ScreenHandlerType.GENERIC_9X1, player, false);
SimpleGui gui = new SimpleGui(ScreenHandlerType.GENERIC_9X1, player, false) {
@Override
public void onTick() {
if (entity.isRemoved() || entity.getPos().squaredDistanceTo(player.getPos()) > 24 * 24) {
this.close();
}
super.onTick();
}
};;

ItemFrameInventory inventory = new ItemFrameInventory(entity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ItemFrameInventory(ItemFrameEntity entity) {

@Override
public int size() {
return 6;
return 1;
}

@Override
Expand All @@ -32,11 +32,17 @@ public List<ItemStack> getItems() {

@Override
public ItemStack getStack(int slot) {
if (this.entity.isRemoved()) {
return ItemStack.EMPTY;
}
return entity.getHeldItemStack();
}

@Override
public ItemStack removeStack(int slot, int amount) {
if (this.entity.isRemoved()) {
return ItemStack.EMPTY;
}
ItemStack result = Inventories.splitStack(this.getItems(), slot, amount);
if (!result.isEmpty()) {
markDirty();
Expand All @@ -46,11 +52,17 @@ public ItemStack removeStack(int slot, int amount) {

@Override
public ItemStack removeStack(int slot) {
if (this.entity.isRemoved()) {
return ItemStack.EMPTY;
}
return Inventories.removeStack(this.getItems(), slot);
}

@Override
public void setStack(int slot, ItemStack stack) {
if (this.entity.isRemoved()) {
return;
}
this.entity.setHeldItemStack(stack);
}

Expand All @@ -66,6 +78,9 @@ public boolean canPlayerUse(PlayerEntity player) {

@Override
public void clear() {
if (this.entity.isRemoved()) {
return;
}
this.entity.setHeldItemStack(ItemStack.EMPTY);
}
}

0 comments on commit 43b43b5

Please sign in to comment.