Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Eriksonnaren authored Apr 1, 2022
2 parents 98f5d7a + 811dfad commit b4d43f3
Show file tree
Hide file tree
Showing 55 changed files with 1,804 additions and 134 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false

minecraft_version=1.16.5
jei_version=7.7.0.106
forge_version=36.2.20
forge_version=36.2.28
modid="createaeronautics"

forgegradle_version=5.1+
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 7 additions & 4 deletions src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ a46ab507ff2143e0354586a09eb4a47a710df479 assets/createaeronautics/blockstates/ai
388cbfb2ec3b4b10e3c534a347f56ff799688525 assets/createaeronautics/blockstates/levitite_casing.json
f03bd9993220fb1d344cec8604dbd88d3b7b1275 assets/createaeronautics/blockstates/propeller_bearing.json
1d6fcfae6cc5e594163e320cfc3d9c8b791a6e1c assets/createaeronautics/blockstates/stationary_potato_cannon.json
ec6500ca9e9055d656869cd2ff306d420eb8bd1b assets/createaeronautics/blockstates/stirling_engine.json
56f827d9b1dcf205d37a6a9ee82019e2b9498330 assets/createaeronautics/blockstates/torsion_spring.json
f8f9af452f83ba240bc7f679dc21d5c0254f34b0 assets/createaeronautics/lang/en_ud.json
ff0b742606f77205d671e56ede60b68d31f79e60 assets/createaeronautics/lang/en_us.json
d12e1d568d692a8d3b41e6b87cfd2478d4f5a82e assets/createaeronautics/lang/en_ud.json
cf023ab6131053f637e08900a750be2bda1e17f4 assets/createaeronautics/lang/en_us.json
dd3444734415a2561192315a438498716b0a325a assets/createaeronautics/models/block/levitite_casing.json
5eb012264762a5949ac970bebf2675d258e005ff assets/createaeronautics/models/item/airship_assembler.json
194aefcc12c8a23ac02b86462b1ec69f2584f8d6 assets/createaeronautics/models/item/endstone_powder.json
5871bf294c63708c0d684eb8f5193bdc1896a160 assets/createaeronautics/models/item/levitite_casing.json
63155e7cee935a962fb05bd7ac7e6d612c8e0f76 assets/createaeronautics/models/item/levitite_casing.json
6ae86017bfb5b00c38c693e7ed965b6214427d7e assets/createaeronautics/models/item/propeller_bearing.json
7fc727516fad944ede696160be5c0240585e4caa assets/createaeronautics/models/item/stationary_potato_cannon.json
43a71f91f857e9cc3f5196a9ddc97564a06893ad assets/createaeronautics/models/item/stirling_engine.json
c60b75429af4cde62f0db4123de91fbf6eefd671 assets/createaeronautics/models/item/torsion_spring.json
0b930418659f22732e3572d9df032811d17f1145 data/create/tags/blocks/safe_nbt.json
ae6560f8e5bdc5f962bb8bac2a40990cee42cf02 data/create/tags/blocks/safe_nbt.json
8e6e31749755efef7f36fa96811f282486b456e9 data/createaeronautics/loot_tables/blocks/airship_assembler.json
a9765079a36fd299ea7fab5eded12193136e58b1 data/createaeronautics/loot_tables/blocks/levitite_casing.json
22b3fd57ee0cd5a3d102aa8cb1f0d027e415917e data/createaeronautics/loot_tables/blocks/propeller_bearing.json
336e90a1ec314af4263c6edfc07ed621927b84ce data/createaeronautics/loot_tables/blocks/stationary_potato_cannon.json
b840398dec616621b541a1c69ca26b95b466d67e data/createaeronautics/loot_tables/blocks/stirling_engine.json
bc745c27abcc4a469b11ff598af1af1ae6a4cc4c data/createaeronautics/loot_tables/blocks/torsion_spring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"variants": {
"facing=north,lit=false": {
"model": "createaeronautics:block/stirling_engine/block"
},
"facing=south,lit=false": {
"model": "createaeronautics:block/stirling_engine/block",
"y": 180
},
"facing=west,lit=false": {
"model": "createaeronautics:block/stirling_engine/block",
"y": 270
},
"facing=east,lit=false": {
"model": "createaeronautics:block/stirling_engine/block",
"y": 90
},
"facing=north,lit=true": {
"model": "createaeronautics:block/stirling_engine/block_lit"
},
"facing=south,lit=true": {
"model": "createaeronautics:block/stirling_engine/block_lit",
"y": 180
},
"facing=west,lit=true": {
"model": "createaeronautics:block/stirling_engine/block_lit",
"y": 270
},
"facing=east,lit=true": {
"model": "createaeronautics:block/stirling_engine/block_lit",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"block.createaeronautics.levitite_casing": "bu\u0131s\u0250\u0186 \u01DD\u0287\u0131\u0287\u0131\u028C\u01DD\uA780",
"block.createaeronautics.propeller_bearing": "bu\u0131\u0279\u0250\u01DD\u15FA \u0279\u01DD\u05DF\u05DF\u01DDdo\u0279\u0500",
"block.createaeronautics.stationary_potato_cannon": "uouu\u0250\u0186 o\u0287\u0250\u0287o\u0500 \u028E\u0279\u0250uo\u0131\u0287\u0250\u0287S",
"block.createaeronautics.stirling_engine": "\u01DDu\u0131bu\u018E bu\u0131\u05DF\u0279\u0131\u0287S",
"block.createaeronautics.torsion_spring": "bu\u0131\u0279dS uo\u0131s\u0279o\u27D8",
"createaeronautics.ponder.stirling_engine.header": "\u01DDu\u0131bu\u018E bu\u0131\u05DF\u0279\u0131\u0287S \u01DD\u0265\u0287 bu\u0131sn \u01DD\u0254\u0279o\u2132 \u05DF\u0250uo\u0131\u0287\u0250\u0287o\u1D1A bu\u0131\u0287\u0250\u0279\u01DDu\u01DD\u2141",
"createaeronautics.ponder.stirling_engine.text_1": "\u05DF\u01DDn\u025F bu\u0131u\u0279nq \u028Eq \u01DD\u0254\u0279o\u025F \u05DF\u0250uo\u0131\u0287\u0250\u0287o\u0279 s\u01DD\u0287\u0250\u0279\u01DDu\u01DDb \u01DDu\u0131bu\u018E bu\u0131\u05DF\u0279\u0131\u0287S \u01DD\u0265\u27D8",
"createaeronautics.ponder.stirling_engine.text_2": "\u028E\u0287\u0131\u0254\u0250d\u0250\u0254 ss\u01DD\u0279\u0287s \u025Fo \u0287uno\u026F\u0250 \u01DD\u0287\u0250\u0279\u01DDpo\u026F \u0250 s\u01DDp\u0131\u028Co\u0279d \u01DDu\u0131bu\u01DD \u01DD\u0265\u27D8",
"createaeronautics.ponder.stirling_engine.text_3": "su\u0250\u01DD\u026F \u0254\u0131\u0287\u0250\u026Fo\u0287n\u0250 \u028Eq p\u01DD\u0287\u0279\u01DDsu\u0131 \u01DDq u\u0250\u0254 \u05DF\u01DDn\u2132",
"death.attack.createaeronautics.stationary_potato_cannon": "uouu\u0250\u0186 o\u0287\u0250\u0287o\u0500 \u028E\u0279\u0250uo\u0131\u0287\u0250\u0287S \u0250 \u028Eq \u0287o\u0265s s\u0250\u028D %1$s",
"death.attack.createaeronautics.stationary_potato_cannon.item": "%2$s bu\u0131sn uouu\u0250\u0186 o\u0287\u0250\u0287o\u0500 \u028E\u0279\u0250uo\u0131\u0287\u0250\u0287S \u0250 \u028Eq \u0287o\u0265s s\u0250\u028D %1$s",
"entity.createaeronautics.airship_contraption": "uo\u0131\u0287d\u0250\u0279\u0287uo\u0186 d\u0131\u0265s\u0279\u0131\u2C6F",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"block.createaeronautics.levitite_casing": "Levitite Casing",
"block.createaeronautics.propeller_bearing": "Propeller Bearing",
"block.createaeronautics.stationary_potato_cannon": "Stationary Potato Cannon",
"block.createaeronautics.stirling_engine": "Stirling Engine",
"block.createaeronautics.torsion_spring": "Torsion Spring",
"createaeronautics.ponder.stirling_engine.header": "Generating Rotational Force using the Stirling Engine",
"createaeronautics.ponder.stirling_engine.text_1": "The Stirling Engine generates rotational force by burning fuel",
"createaeronautics.ponder.stirling_engine.text_2": "The engine provides a moderate amount of stress capacity",
"createaeronautics.ponder.stirling_engine.text_3": "Fuel can be inserted by automatic means",
"death.attack.createaeronautics.stationary_potato_cannon": "%1$s was shot by a Stationary Potato Cannon",
"death.attack.createaeronautics.stationary_potato_cannon.item": "%1$s was shot by a Stationary Potato Cannon using %2$s",
"entity.createaeronautics.airship_contraption": "Airship Contraption",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"parent": "createaeronautics:block/levitite_casing/item"
"parent": "createaeronautics:block/levitite_casing"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "createaeronautics:block/stirling_engine/item"
}
29 changes: 5 additions & 24 deletions src/generated/resources/data/create/tags/blocks/safe_nbt.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
{
"replace": false,
"values": [
"create:creative_motor",
"create:creative_fluid_tank",
"create:mechanical_piston",
"create:sticky_mechanical_piston",
"create:windmill_bearing",
"create:mechanical_bearing",
"create:clockwork_bearing",
"create:rope_pulley",
"create:cart_assembler",
"create:linear_chassis",
"create:secondary_linear_chassis",
"create:radial_chassis",
"create:sequenced_gearshift",
"create:rotation_speed_controller",
"create:andesite_funnel",
"create:andesite_belt_funnel",
"create:brass_funnel",
"create:brass_belt_funnel",
"create:creative_crate",
"create:redstone_link",
"create:analog_lever",
"create:adjustable_repeater",
"create:adjustable_pulse_repeater",
"#minecraft:signs"
"createaeronautics:torsion_spring",
"createaeronautics:airship_assembler",
"createaeronautics:propeller_bearing",
"createaeronautics:stationary_potato_cannon",
"createaeronautics:stirling_engine"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "createaeronautics:stirling_engine"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package com.eriksonn.createaeronautics;

import com.eriksonn.createaeronautics.index.CAParticleTypes;
import com.eriksonn.createaeronautics.ponder.CAPonderIndex;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

public class CreateAeronauticsClient {
public static void onCtorClient(IEventBus modEventBus, IEventBus forgeEventBus) {
modEventBus.addListener(CAParticleTypes::registerFactories);
modEventBus.addListener(CreateAeronauticsClient::clientInit);

}
public static void clientInit(final FMLClientSetupEvent event) {
CAPonderIndex.register();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.eriksonn.createaeronautics.blocks.propeller_bearing;

public interface MecanicalBearingTileEntityExtension {
boolean isPropeller();
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package com.eriksonn.createaeronautics.blocks.propeller_bearing;

import com.eriksonn.createaeronautics.index.CATileEntities;
import com.eriksonn.createaeronautics.mixins.MechanicalBearingTileEntityAccessor;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.BearingBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingTileEntity;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.tileentity.TileEntity;
Expand Down Expand Up @@ -63,7 +59,7 @@ public ActionResultType use(BlockState state, World worldIn, BlockPos pos, Playe
te.startDisassemblySlowdown();
return;
}
((MechanicalBearingTileEntityAccessor) te).setAssembleNextTick(true);
te.setAssembleNextTick(true);
//te.assembleNextTick
});
return ActionResultType.SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.eriksonn.createaeronautics.blocks.propeller_bearing;

import com.eriksonn.createaeronautics.blocks.stationary_potato_cannon.StationaryPotatoCannonTileEntity;
import com.eriksonn.createaeronautics.particle.PropellerAirParticleData;
import com.simibubi.create.AllTags;
import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.components.structureMovement.ControlledContraptionEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.BearingContraption;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingTileEntity;

import com.simibubi.create.content.contraptions.particle.AirParticleData;
import com.simibubi.create.foundation.gui.AllIcons;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.INamedIconOptions;
Expand All @@ -17,7 +14,6 @@
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntityType;
Expand All @@ -33,13 +29,14 @@
import java.util.List;
import java.util.Map;

public class PropellerBearingTileEntity extends MechanicalBearingTileEntity{
public class PropellerBearingTileEntity extends MechanicalBearingTileEntity implements MecanicalBearingTileEntityExtension{
public ScrollOptionBehaviour<PropellerBearingTileEntity.RotationDirection> movementDirection;
protected float lastGeneratedSpeed;
public List<BlockPos> sailPositions;
float rotationSpeed=0;
float disassemblyTimer;
boolean disassemblySlowdown=false;

public PropellerBearingTileEntity(TileEntityType<? extends MechanicalBearingTileEntity> type) {
super(type);
sailPositions=new ArrayList<>();
Expand Down Expand Up @@ -103,7 +100,7 @@ public float getAngularSpeed() {
float speed = rotationSpeed;
if (level.isClientSide) {
speed *= ServerSpeedProvider.get();
//speed += clientAngleDiff / 3f;
speed += clientAngleDiff / 3f;
}
return speed;
}
Expand Down Expand Up @@ -160,11 +157,9 @@ void updateSlowdownSpeed()
// the closest grid-aligned angle to currentStoppingPoint
float optimalStoppingPoint = 90f*Math.round(currentStoppingPoint/90f);

// Q is an inverse-lerp that solves this equation:
// optimalStoppingPoint = lerp(currentStoppingPoint,angle,Q)
float Q = (optimalStoppingPoint-currentStoppingPoint)/(angle-currentStoppingPoint);
float Q = (optimalStoppingPoint-currentStoppingPoint)/disassemblyTimer;

rotationSpeed *= (1f - 3f*Q/disassemblyTimer)*(1f - 1f/disassemblyTimer);
rotationSpeed = (rotationSpeed + 6f*Q/disassemblyTimer)*(1f - 1f/disassemblyTimer);
}
@Override
public void attach(ControlledContraptionEntity contraption)
Expand All @@ -180,12 +175,17 @@ public void assemble()
super.assemble();
findSails();
}

@Override
public void disassemble()
{

super.disassemble();
}

public void setAssembleNextTick(boolean value) {
assembleNextTick = value;
}

public void startDisassemblySlowdown()
{
if(!disassemblySlowdown) {
Expand All @@ -208,7 +208,7 @@ void findSails()

public void spawnParticles()
{
if(getSpeed()!=0 && movedContraption!=null &&isRunning()) {
if(Math.abs(rotationSpeed)>0.01 && movedContraption!=null &&isRunning()) {
World world = getLevel();
Direction direction = getBlockState().getValue(BlockStateProperties.FACING);
Vector3f speed = new Vector3f(direction.getNormal().getX(), direction.getNormal().getY(), direction.getNormal().getZ());
Expand Down Expand Up @@ -254,6 +254,11 @@ protected void setBlockDirection(PropellerBearingBlock.Direction direction) {
notifyUpdate();
}

@Override
public boolean isPropeller() {
return true;
}

static enum RotationDirection implements INamedIconOptions {

CLOCKWISE(AllIcons.I_REFRESH), COUNTER_CLOCKWISE(AllIcons.I_ROTATE_CCW),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.eriksonn.createaeronautics.blocks.stationary_potato_cannon;

import com.eriksonn.createaeronautics.index.CABlocks;
import com.eriksonn.createaeronautics.utils.PotatoProjectileEntityExtension;
import com.simibubi.create.AllEntityTypes;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.Create;
Expand Down Expand Up @@ -180,7 +181,7 @@ void Shoot()
for(int i = 0; i < projectileType.getSplit(); ++i) {
PotatoProjectileEntity projectile = AllEntityTypes.POTATO_PROJECTILE.create(this.level);
// == This is the new code that fixes the death message. ==
((PotatoProjectileEntityFix) projectile).setIsFromStationaryPotatoCannon(true);
((PotatoProjectileEntityExtension) projectile).setIsFromStationaryPotatoCannon(true);
// ========================================================
projectile.setItem(currentStack);

Expand Down
Loading

0 comments on commit b4d43f3

Please sign in to comment.