Skip to content

Commit

Permalink
Merge pull request #649 from rbasamoyai/1.18.2/dev
Browse files Browse the repository at this point in the history
Starting 5.6.0 for Create 0.5.1.g
  • Loading branch information
rbasamoyai authored Aug 27, 2024
2 parents e196e52 + 2d4c94c commit c5f0ae2
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 21 deletions.
13 changes: 13 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Changelog

5.6.0

Create Big Cannons 5.6.0. Now supports Create 0.5.1 patch G.
Comes with a few fixes and updates.

Changed:
- Updated Create Big Cannons logo to new style
- Updated Ukrainian translation courtesy of kyryloborsch
Fixed:
- Fixed cannon carriages being broken by projectiles
- Fixed first-person handle autocannon carriage movement jitter
- Fixed incorrect big cannon failure ponder text

5.5.1

Create Big Cannons 5.5.1. A few critical fixes for 5.5.0 as well as some code changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.mojang.blaze3d.platform.InputConstants;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f;
import com.simibubi.create.foundation.utility.VecHelper;

import net.minecraft.client.Camera;
import net.minecraft.client.CameraType;
Expand Down Expand Up @@ -302,7 +303,12 @@ public static boolean onCameraSetup(Camera camera, double partialTicks, Supplier
Vec3 localPos = Vec3.atCenterOf(poce.getSeatPos(player));
if (mc.options.getCameraType() == CameraType.FIRST_PERSON) {
localPos = localPos.add(upNormal.scale(0.35));
Vec3 camPos = poce.toGlobalVector(localPos, (float) partialTicks);
Vec3 rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO);
Vec3 anchor = poce.getPrevAnchorVec().lerp(poce.getAnchorVec(), partialTicks);

Vec3 camPos = localPos.subtract(rotationOffset);
camPos = poce.applyRotation(camPos, (float) partialTicks);
camPos = camPos.add(anchor).add(rotationOffset);
camAccess.callSetPosition(camPos);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ public void fireShot(ServerLevel level, PitchOrientedContraptionEntity entity) {
projectile.shoot(vec1.x, vec1.y, vec1.z, speed, spread);
projectile.xRotO = projectile.getXRot();
projectile.yRotO = projectile.getYRot();

projectile.addUntouchableEntity(entity, 1);
Entity vehicle = entity.getVehicle();
if (vehicle != null && CBCEntityTypes.CANNON_CARRIAGE.is(vehicle))
projectile.addUntouchableEntity(vehicle, 1);

level.addFreshEntity(projectile);
if (roundProperties != null) recoilMagnitude += roundProperties.addedRecoil();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import rbasamoyai.createbigcannons.effects.particles.plumes.DropMortarPlumeParticleData;
import rbasamoyai.createbigcannons.index.CBCBigCannonMaterials;
import rbasamoyai.createbigcannons.index.CBCContraptionTypes;
import rbasamoyai.createbigcannons.index.CBCEntityTypes;
import rbasamoyai.createbigcannons.index.CBCSoundEvents;
import rbasamoyai.createbigcannons.munitions.big_cannon.AbstractBigCannonProjectile;
import rbasamoyai.createbigcannons.munitions.big_cannon.DropMortarMunition;
Expand Down Expand Up @@ -437,6 +438,12 @@ public void fireShot(ServerLevel level, PitchOrientedContraptionEntity entity) {
projectile.shoot(vec.x, vec.y, vec.z, propelCtx.chargesUsed, propelCtx.spread);
projectile.xRotO = projectile.getXRot();
projectile.yRotO = projectile.getYRot();

projectile.addUntouchableEntity(entity, 1);
Entity vehicle = entity.getVehicle();
if (vehicle != null && CBCEntityTypes.CANNON_CARRIAGE.is(vehicle))
projectile.addUntouchableEntity(vehicle, 1);

level.addFreshEntity(projectile);
recoilMagnitude += projectile.addedRecoil();
}
Expand Down Expand Up @@ -661,6 +668,12 @@ public void actuallyFireDropMortar() {
projectile.shoot(vec.x, vec.y, vec.z, power, spread);
projectile.xRotO = projectile.getXRot();
projectile.yRotO = projectile.getYRot();

projectile.addUntouchableEntity(entity, 1);
Entity vehicle = entity.getVehicle();
if (vehicle != null && CBCEntityTypes.CANNON_CARRIAGE.is(vehicle))
projectile.addUntouchableEntity(vehicle, 1);

slevel.addFreshEntity(projectile);

recoilMagnitude *= CBCConfigs.SERVER.cannons.bigCannonRecoilScale.getF();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ public InteractionResult useOn(UseOnContext context) {
level.setBlock(pos2, info.state, Block.UPDATE_MOVE_BY_PISTON | Block.UPDATE_ALL);
BlockEntity be2 = level.getBlockEntity(pos2);
CompoundTag tag = info.nbt;
if (be2 != null) tag = NBTProcessors.process(be2, tag, false);
if (be2 != null)
tag = NBTProcessors.process(info.state, be2, tag, false);
if (be2 != null && tag != null) {
tag.putInt("x", pos2.getX());
tag.putInt("y", pos2.getY());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public InteractionResult useOn(UseOnContext context) {
level.setBlock(pos2, info.state, Block.UPDATE_MOVE_BY_PISTON | Block.UPDATE_ALL);
BlockEntity be2 = level.getBlockEntity(pos2);
CompoundTag tag = info.nbt;
if (be2 != null) tag = NBTProcessors.process(be2, tag, false);
if (be2 != null)
tag = NBTProcessors.process(info.state, be2, tag, false);
if (be2 != null && tag != null) {
tag.putInt("x", pos2.getX());
tag.putInt("y", pos2.getY());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package rbasamoyai.createbigcannons.munitions;

import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -59,6 +61,7 @@ public abstract class AbstractCannonProjectile extends Projectile implements Syn
protected BlockState lastPenetratedBlock = Blocks.AIR.defaultBlockState();
protected boolean removeNextTick = false;
protected int localSoundCooldown;
protected WeakHashMap<Entity, Integer> untouchableEntities = new WeakHashMap<>();

protected AbstractCannonProjectile(EntityType<? extends AbstractCannonProjectile> type, Level level) {
super(type, level);
Expand Down Expand Up @@ -123,6 +126,15 @@ public void tick() {
this.setXRot(lerpRotation(this.xRotO, this.getXRot()));
}

for (Iterator<Map.Entry<Entity, Integer>> iter = this.untouchableEntities.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry<Entity, Integer> entry = iter.next();
if (entry.getKey().isRemoved() || entry.getValue() > 0 && entry.getValue() - 1 == 0) {
iter.remove();
} else if (entry.getValue() > 0) {
entry.setValue(entry.getValue() - 1);
}
}

if (this.inFluidTime > 0)
--this.inFluidTime;
if (this.penetrationTime > 0)
Expand Down Expand Up @@ -537,7 +549,25 @@ protected double getDragForce() {

public void setChargePower(float power) {}

@Override public boolean canHitEntity(Entity entity) { return super.canHitEntity(entity) && !(entity instanceof Projectile); }
@Override
public boolean canHitEntity(Entity entity) {
if (!super.canHitEntity(entity))
return false;
if (entity instanceof Projectile)
return false; // TODO better detection for interception?
return !this.untouchableEntities.containsKey(entity);
}

public void addUntouchableEntity(Entity entity, int duration) {
if (entity.isRemoved())
return;
if (duration < 1)
throw new IllegalArgumentException("Use #addAlwaysUntouchableEntity when duration < 1 (was " + duration + ")");
this.untouchableEntities.put(entity, duration);
}

public void addAlwaysUntouchableEntity(Entity entity) { this.untouchableEntities.put(entity, -1); }
public void removeUntouchableEntity(Entity entity) { this.untouchableEntities.remove(entity); }

public boolean canLingerInGround() { return false; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static void cannonLoads(SceneBuilder scene, SceneBuildingUtil util) {
scene.overlay.showText(100).text("When loading a cannon, care must be taken to ensure that cannon loads are safe and effective.");
scene.idle(110);

scene.overlay.showText(80).text("A cannon's material has two main factors that can cause the cannon to fail; its main factor and its strength.").colored(PonderPalette.RED);
scene.overlay.showText(80).text("A cannon's material has two main factors that can cause the cannon to fail; its minimum projectile velocity per barrel and its strength.").colored(PonderPalette.RED);
scene.idle(90);

scene.overlay.showText(80)
Expand Down
4 changes: 2 additions & 2 deletions fabric/src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ a21c4e4eebeff2daf1f081cd6226f29adfeade7c data\createbigcannons\loot_tables\block
235661158f753902ef6973695297617954ce8c74 assets\createbigcannons\blockstates\creative_autocannon_ammo_container.json
9ea4762a05a584971ebbabbe4aed59f2d83cfca5 data\createbigcannons\recipes\melting\melt_cast_iron_ingot.json
f606cce56a47d59c2633a8aa927664ca33c0fd81 data\createbigcannons\loot_tables\blocks\unbored_bronze_sliding_breech.json
02c3f1233db8cacdec1205016c6c009fa47ac2f1 assets\createbigcannons\lang\en_us.json
b88d8134d866696c003137d3f273d698285cab0f assets\createbigcannons\lang\en_us.json
ed30fb599beda650e7c03f73f81740f575878072 data\createbigcannons\advancements\recipes\createbigcannons\nethersteel_block.json
dec72a3d3bdf8f0783b06a066ce558fd44a46878 assets\createbigcannons\models\block\unbored_nethersteel_screw_breech.json
020c4503bc250b1d631c454763e13240290a257a assets\createbigcannons\models\block\unbored_cast_iron_sliding_breech.json
Expand Down Expand Up @@ -374,7 +374,7 @@ bc887982390ad450c9924b6b072b793018e89ffd data\createbigcannons\tags\items\gunpow
5ddd76a06525dbe65e687e40426392fa0ed69c08 assets\createbigcannons\models\block\cannon_cast.json
2975e49c94758d2f84a1a2019fbe577db1e3d630 assets\createbigcannons\models\item\sliding_breech_cast_mould.json
0ef027e38fb552bd7a69c22e7bf238c0052b491d assets\createbigcannons\models\block\wrought_iron_drop_mortar_end.json
47c0748e2071540aecaa696e0461f98873a7db02 assets\createbigcannons\lang\en_ud.json
009c5adeeac0dd5b18f6ca4057534a80e009eff8 assets\createbigcannons\lang\en_ud.json
7fa5065e32210f792d1daad2d7268247904f6252 data\minecraft\tags\blocks\mineable\axe.json
847dd1470953cd5956b5f6edb733cdb0bafddd3c assets\createbigcannons\models\block\incomplete_bronze_autocannon_recoil_spring.json
236281fc879d0281e93d7a9b4f7fadfbed3c31b7 data\createbigcannons\recipes\wrought_iron_cannon_end.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
"createbigcannons.ponder.munitions/cannon_loads.text_11": "\u02D9\u02D9\u02D9s\u01DDb\u0279\u0250\u0265\u0186 \u0279\u01DDp\u028Do\u0500 \u028Eu\u0250\u026F oo\u0287 bu\u0131p\u0250o\u05DF\u02D9\u02D9\u02D9",
"createbigcannons.ponder.munitions/cannon_loads.text_12": "\u02D9\u02D9\u02D9\u05DF\u01DD\u0279\u0279\u0250q \u01DD\u0265\u0287 u\u0131 \u0287\u0254\u01DD\u0638qo \u0279\u01DD\u0265\u0287ou\u0250 \u0265\u0287\u0131\u028D \u01DDp\u0131\u05DF\u05DFo\u0254 o\u0287 \u01DD\u05DF\u0131\u0287\u0254\u01DD\u0638o\u0279d p\u01DD\u0279\u0131\u025F \u0250 bu\u0131\u028Do\u05DF\u05DF\u0250\u02D9\u02D9\u02D9",
"createbigcannons.ponder.munitions/cannon_loads.text_13": "\u02D9\u0287u\u01DD\u026Fuo\u0279\u0131\u028Cu\u01DD bu\u0131puno\u0279\u0279ns \u01DD\u0265\u0287 o\u0287 \u0287\u0250\u01DD\u0279\u0265\u0287 \u0279o\u0638\u0250\u026F \u0250 \u01DDsod pu\u0250 \u01DD\u0279n\u05DF\u0131\u0250\u025F \u0254\u0131\u0265do\u0279\u0287s\u0250\u0287\u0250\u0254 \u01DDsn\u0250\u0254 u\u0250\u0254\u02D9\u02D9\u02D9",
"createbigcannons.ponder.munitions/cannon_loads.text_2": "\u02D9\u0265\u0287bu\u01DD\u0279\u0287s s\u0287\u0131 pu\u0250 \u0279o\u0287\u0254\u0250\u025F u\u0131\u0250\u026F s\u0287\u0131 \u061B\u05DF\u0131\u0250\u025F o\u0287 uouu\u0250\u0254 \u01DD\u0265\u0287 \u01DDsn\u0250\u0254 u\u0250\u0254 \u0287\u0250\u0265\u0287 s\u0279o\u0287\u0254\u0250\u025F u\u0131\u0250\u026F o\u028D\u0287 s\u0250\u0265 \u05DF\u0250\u0131\u0279\u01DD\u0287\u0250\u026F s,uouu\u0250\u0254 \u2C6F",
"createbigcannons.ponder.munitions/cannon_loads.text_2": "\u02D9\u0265\u0287bu\u01DD\u0279\u0287s s\u0287\u0131 pu\u0250 \u05DF\u01DD\u0279\u0279\u0250q \u0279\u01DDd \u028E\u0287\u0131\u0254o\u05DF\u01DD\u028C \u01DD\u05DF\u0131\u0287\u0254\u01DD\u0638o\u0279d \u026Fn\u026F\u0131u\u0131\u026F s\u0287\u0131 \u061B\u05DF\u0131\u0250\u025F o\u0287 uouu\u0250\u0254 \u01DD\u0265\u0287 \u01DDsn\u0250\u0254 u\u0250\u0254 \u0287\u0250\u0265\u0287 s\u0279o\u0287\u0254\u0250\u025F u\u0131\u0250\u026F o\u028D\u0287 s\u0250\u0265 \u05DF\u0250\u0131\u0279\u01DD\u0287\u0250\u026F s,uouu\u0250\u0254 \u2C6F",
"createbigcannons.ponder.munitions/cannon_loads.text_3": "\u02D9uouu\u0250\u0254 \u0250 u\u0131 \u029E\u0254n\u0287s \u0287\u01DDb \u0287ou o\u0287 \u01DD\u028C\u0250\u0265 p\u05DFno\u0265s \u01DD\u05DF\u0131\u0287\u0254\u01DD\u0638o\u0279d \u0250 \u0279\u01DD\u028Dod \u0265\u0254n\u026F \u028Do\u0265 s\u01DDu\u0131\u026F\u0279\u01DD\u0287\u01DDp \u05DF\u01DD\u0279\u0279\u0250q \u0279\u01DDd \u028E\u0287\u0131\u0254o\u05DF\u01DD\u028C \u01DD\u05DF\u0131\u0287\u0254\u01DD\u0638o\u0279d \u026Fn\u026F\u0131u\u0131\u026F \u01DD\u0265\u27D8",
"createbigcannons.ponder.munitions/cannon_loads.text_4": "\u02D9\u05DF\u01DD\u0279\u0279\u0250q \u028E\u0279\u01DD\u028C\u01DD \u0279o\u025F \u01DDb\u0279\u0250\u0265\u0186 \u0279\u01DDp\u028Do\u0500 \u0196 o\u0287 \u0287u\u01DD\u05DF\u0250\u028C\u0131nb\u01DD s\u0131 uo\u0279\u0131 \u0287s\u0250\u0254 \u025Fo \u028E\u0287\u0131\u0254o\u05DF\u01DD\u028C \u01DD\u05DF\u0131\u0287\u0254\u01DD\u0638o\u0279d \u026Fn\u026F\u0131u\u0131\u026F \u0287\u05DFn\u0250\u025F\u01DDp \u01DD\u0265\u0287 '\u01DD\u05DFd\u026F\u0250x\u01DD \u0279o\u2132",
"createbigcannons.ponder.munitions/cannon_loads.text_5": "\u02D9p\u01DD\u05DF\u05DF\u01DD\u028C\u0250\u0279\u0287 s\u05DF\u01DD\u0279\u0279\u0250q \u01DD\u0265\u0287 sp\u0279\u0250\u028Do\u0287 p\u01DD\u0287uno\u0254 os\u05DF\u0250 s\u0131 u\u0131 s\u0131 \u01DD\u05DF\u0131\u0287\u0254\u01DD\u0638o\u0279d p\u01DDp\u0250o\u05DF \u01DD\u0265\u0287 \u0287\u0250\u0265\u0287 \u05DF\u01DD\u0279\u0279\u0250q \u01DD\u0265\u27D8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
"createbigcannons.ponder.munitions/cannon_loads.text_11": "...loading too many Powder Charges...",
"createbigcannons.ponder.munitions/cannon_loads.text_12": "...allowing a fired projectile to collide with another object in the barrel...",
"createbigcannons.ponder.munitions/cannon_loads.text_13": "...can cause catastrophic failure and pose a major threat to the surrounding environment.",
"createbigcannons.ponder.munitions/cannon_loads.text_2": "A cannon's material has two main factors that can cause the cannon to fail; its main factor and its strength.",
"createbigcannons.ponder.munitions/cannon_loads.text_2": "A cannon's material has two main factors that can cause the cannon to fail; its minimum projectile velocity per barrel and its strength.",
"createbigcannons.ponder.munitions/cannon_loads.text_3": "The minimum projectile velocity per barrel determines how much power a projectile should have to not get stuck in a cannon.",
"createbigcannons.ponder.munitions/cannon_loads.text_4": "For example, the default minimum projectile velocity of cast iron is equivalent to 1 Powder Charge for every barrel.",
"createbigcannons.ponder.munitions/cannon_loads.text_5": "The barrel that the loaded projectile is in is also counted towards the barrels travelled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.platform.Window;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.content.equipment.goggles.GoggleOverlayRenderer;

Expand All @@ -19,11 +18,12 @@
import rbasamoyai.createbigcannons.block_armor_properties.BlockArmorInspectionToolItem;

@Mixin(GoggleOverlayRenderer.class)
public class GoggleOverlayRendererMixin {
public class
GoggleOverlayRendererMixin {

@Inject(method = "renderOverlay",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientLevel;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;", ordinal = 0))
private static void createbigcannons$renderOverlay(PoseStack poseStack, float partialTicks, Window window, CallbackInfo ci,
private static void createbigcannons$renderOverlay(PoseStack poseStack, float partialTicks, int width, int height, CallbackInfo ci,
@Local List<Component> tooltip, @Local ClientLevel level, @Local BlockPos pos) {
Minecraft minecraft = Minecraft.getInstance();
if (!BlockArmorInspectionToolItem.isHoldingTool(minecraft.player))
Expand Down
Binary file modified fabric/src/main/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions forge/src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ c58a162ab33e2d4841b7ccde59fa022506ef5dcc assets/createbigcannons/blockstates/ver
8cc31b88cd6093baa4caddb02ff7f7ff793299f4 assets/createbigcannons/blockstates/wrought_iron_cannon_end.json
303668cdb3754018ca137ea6074801c6927d3987 assets/createbigcannons/blockstates/wrought_iron_drop_mortar_end.json
d942040026b2849ca2153a9933e8dc0c5c39f3c9 assets/createbigcannons/blockstates/yaw_controller.json
47c0748e2071540aecaa696e0461f98873a7db02 assets/createbigcannons/lang/en_ud.json
02c3f1233db8cacdec1205016c6c009fa47ac2f1 assets/createbigcannons/lang/en_us.json
009c5adeeac0dd5b18f6ca4057534a80e009eff8 assets/createbigcannons/lang/en_ud.json
b88d8134d866696c003137d3f273d698285cab0f assets/createbigcannons/lang/en_us.json
c6129d8380bcb26579fc200fc054f4a485ad9b2a assets/createbigcannons/models/block/ap_shell.json
14e7b948a05007b8c96e35f92f0bff66427de7b8 assets/createbigcannons/models/block/ap_shot.json
7157cc923bd4f217cb47117fbfe2b9542e367d17 assets/createbigcannons/models/block/autocannon/bronze_autocannon_spring.json
Expand Down
Loading

0 comments on commit c5f0ae2

Please sign in to comment.