Skip to content

Commit

Permalink
Fixed latest PR, probably the last commit from me on this.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBusyBiscuit committed Aug 5, 2020
1 parent 9e66c23 commit 1563de9
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug Report
about: Report a Bug or an Issue with Barrels.
title: ''
labels: bug
assignees: ''

---

## Description (Required)
<!-- A clear and detailed description of what exactly the Issue consists of. -->
<!-- Please try to write as much as possible. "it doesn't work" is not sufficient. -->
<!-- Try to write at least 4-6 sentences. -->

## Steps to reproduce the Issue (Required)
<!-- Youtube Videos and Screenshots are recommended! -->

## Expected behavior (Required)
<!-- What did you expect to happen? -->

## Server Log / Error Report
<!-- Take a look at your Server Log and please provide any error reports you can find via https://pastebin.com/ -->
<!-- We may discard your Issue if you just post it here, as it's unreadable for us. Please use Pastebin! -->

## Environment (Required)
<!-- We may also close your Issue if you are not providing the exact version numbers. -->
<!-- "latest" IS NOT A VERSION NUMBER. -->
<!-- You can also just run "/sf versions" and show us a screenshot of that. -->

- Minecraft Version:
- CS-CoreLib Version:
- Slimefun Version:
- Barrels Version:
23 changes: 23 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Java CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn package --file pom.xml
13 changes: 8 additions & 5 deletions src/main/java/me/john000708/barrels/DisplayItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,32 @@ public static void updateDisplayItem(Block b, int capacity, boolean allow) {
}

Optional<Item> entity = getEntity(b);
Item item;

if (!entity.isPresent()) {
Item item = b.getWorld().dropItem(new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 1.2D, b.getZ() + 0.5D), stack);
item = b.getWorld().dropItem(new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 1.2D, b.getZ() + 0.5D), stack);
item.setVelocity(new Vector(0, 0.1, 0));
item.setCustomNameVisible(true);

PersistentDataAPI.setString(item, NAMESPACED_KEY, toString(b));
}
else {
Item item = entity.get();
item = entity.get();
item.setItemStack(stack);
}

item.setCustomName(nametag);
item.setInvulnerable(true);

if (!SlimefunUtils.hasNoPickupFlag(item)) {
SlimefunUtils.markAsNoPickup(item, "barrel");
SlimefunUtils.markAsNoPickup(item, "barrel");
}
}

public static void removeDisplayItem(Block b) {
getEntity(b).ifPresent(item -> {
item.remove();
item.removeMetadata("no_pickup", Barrels.getInstance());
item.remove();
item.removeMetadata("no_pickup", Barrels.getInstance());
});
}

Expand Down

0 comments on commit 1563de9

Please sign in to comment.