mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Merge branch 'refs/heads/mc1.20.1/feature-dev' into mc1.21.1/dev
# Conflicts: # src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelBlockEntity.java # src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java
This commit is contained in:
commit
ba90f5405b
6 changed files with 562 additions and 511 deletions
|
@ -129,6 +129,7 @@ _Now using Flywheel 1.0_
|
|||
- Fixed lighting on signal block indicators
|
||||
- Fixed vaults and tanks rotated in place not updating their multiblock correctly
|
||||
- Hose pulley now deletes lilypads and other surface foliage
|
||||
- Fixed crushing wheels not applying looting to killed entities
|
||||
|
||||
#### API Changes
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran
|
|||
if (!(level.getBlockEntity(worldPosition.offset(offset)) instanceof ChainConveyorBlockEntity otherLift))
|
||||
continue;
|
||||
for (Iterator<ChainConveyorPackage> iterator = entry.getValue()
|
||||
.iterator(); iterator.hasNext();) {
|
||||
.iterator(); iterator.hasNext(); ) {
|
||||
ChainConveyorPackage box = iterator.next();
|
||||
if (box.justFlipped)
|
||||
continue;
|
||||
|
@ -197,8 +197,9 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran
|
|||
if (stats == null)
|
||||
continue;
|
||||
|
||||
Travelling: for (Iterator<ChainConveyorPackage> iterator = entry.getValue()
|
||||
.iterator(); iterator.hasNext();) {
|
||||
Travelling:
|
||||
for (Iterator<ChainConveyorPackage> iterator = entry.getValue()
|
||||
.iterator(); iterator.hasNext(); ) {
|
||||
ChainConveyorPackage box = iterator.next();
|
||||
box.justFlipped = false;
|
||||
|
||||
|
@ -253,7 +254,8 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran
|
|||
}
|
||||
}
|
||||
|
||||
Looping: for (Iterator<ChainConveyorPackage> iterator = loopingPackages.iterator(); iterator.hasNext();) {
|
||||
Looping:
|
||||
for (Iterator<ChainConveyorPackage> iterator = loopingPackages.iterator(); iterator.hasNext(); ) {
|
||||
ChainConveyorPackage box = iterator.next();
|
||||
box.justFlipped = false;
|
||||
|
||||
|
@ -315,7 +317,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran
|
|||
|
||||
public void removeInvalidConnections() {
|
||||
boolean changed = false;
|
||||
for (Iterator<BlockPos> iterator = connections.iterator(); iterator.hasNext();) {
|
||||
for (Iterator<BlockPos> iterator = connections.iterator(); iterator.hasNext(); ) {
|
||||
BlockPos next = iterator.next();
|
||||
BlockPos target = worldPosition.offset(next);
|
||||
if (!level.isLoaded(target))
|
||||
|
@ -775,7 +777,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran
|
|||
|
||||
@Override
|
||||
public ItemRequirement getRequiredItems(BlockState state) {
|
||||
// Uncomment when Schematicannon is able to print these with chains
|
||||
// TODO: Uncomment when Schematicannon is able to print these with chains
|
||||
// int totalCost = 0;
|
||||
// for (BlockPos pos : connections)
|
||||
// totalCost += getChainCost(pos);
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingDropsEvent;
|
||||
|
@ -57,13 +58,15 @@ public class CrushingWheelBlockEntity extends KineticBlockEntity {
|
|||
fixControllers();
|
||||
}
|
||||
|
||||
// This increases the drops when dropCustomDeathLoot is called, and LootingEnchantFunctionMixin increases the drops
|
||||
// defined in the entity loot table
|
||||
@SubscribeEvent
|
||||
public static void crushingIsFortunate(EntityLootEnchantmentLevelEvent event) {
|
||||
DamageSource damageSource = event.getDamageSource();
|
||||
if (damageSource == null || !damageSource.is(AllDamageTypes.CRUSH))
|
||||
return;
|
||||
// TODO 1.21: check if this works now
|
||||
event.setLevel(2); //This does not currently increase mob drops. It seems like this only works for damage done by an entity.
|
||||
event.setLevel(2);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -288,7 +288,6 @@ public class AllAdvancements implements DataProvider {
|
|||
.after(CARDBOARD_ARMOR)
|
||||
.special(SECRET)),
|
||||
|
||||
// TODO: award using AllAdvancements.CARDBOARD_ARMOR_TRIM.awardTo() on server
|
||||
CARDBOARD_ARMOR_TRIM = create("cardboard_armor_trim",
|
||||
b -> b.icon(AllAdvancements::createArmorTrimmedCardboardChestplate)
|
||||
.title("Arts and Crafts")
|
||||
|
@ -730,6 +729,7 @@ public class AllAdvancements implements DataProvider {
|
|||
advancement.provideLang(consumer);
|
||||
}
|
||||
|
||||
public static void register() {}
|
||||
public static void register() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.simibubi.create.foundation.mixin;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
import com.simibubi.create.AllDamageTypes;
|
||||
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.functions.LootingEnchantFunction;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.NumberProvider;
|
||||
|
||||
@Mixin(LootingEnchantFunction.class)
|
||||
public abstract class LootingEnchantFunctionMixin {
|
||||
@Shadow
|
||||
@Final
|
||||
NumberProvider value;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
int limit;
|
||||
|
||||
@Shadow
|
||||
abstract boolean hasLimit();
|
||||
|
||||
@Inject(method = "run", at = @At("TAIL"))
|
||||
private void create$crushingWheelsHaveLooting(ItemStack stack, LootContext context, CallbackInfoReturnable<ItemStack> cir) {
|
||||
DamageSource damageSource = context.getParamOrNull(LootContextParams.DAMAGE_SOURCE);
|
||||
if (damageSource != null && damageSource.is(AllDamageTypes.CRUSH)) {
|
||||
int lootingLevel = 2;
|
||||
|
||||
float f = (float) lootingLevel * this.value.getFloat(context);
|
||||
stack.grow(Math.round(f));
|
||||
if (this.hasLimit() && stack.getCount() > this.limit)
|
||||
stack.setCount(this.limit);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@
|
|||
"EnchantedCountIncreaseFunctionMixin",
|
||||
"EntityMixin",
|
||||
"LavaSwimmingMixin",
|
||||
"LootingEnchantFunctionMixin",
|
||||
"MapItemSavedDataMixin",
|
||||
"MobMixin",
|
||||
"PlayerMixin",
|
||||
|
|
Loading…
Add table
Reference in a new issue